瀏覽代碼

org-exp: only remove commas on the front line of a code block

* lisp/org-exp.el (org-export-select-backend-specific-text): Only
  remove commas on the front line of a code block.
Eric Schulte 13 年之前
父節點
當前提交
d0a3a3870f
共有 1 個文件被更改,包括 8 次插入2 次删除
  1. 8 2
      lisp/org-exp.el

+ 8 - 2
lisp/org-exp.el

@@ -1738,8 +1738,14 @@ from the buffer."
 		(save-excursion
 		  (save-match-data
 		    (goto-char beg-content)
-		    (while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
-		      (replace-match "" nil nil nil 1))))
+		    (let ((front-line (save-excursion
+					(re-search-forward
+					 "[^[:space:]]" end-content t)
+					(goto-char (match-beginning 0))
+					(current-column))))
+		      (while (re-search-forward "^[ \t]*\\(,\\)" end-content t)
+			(when (= (current-column) front-line)
+			  (replace-match "" nil nil nil 1))))))
 		(delete-region (match-beginning 0) (match-end 0))
 		(save-excursion
 		  (goto-char beg)