ソースを参照

Bugfix: Avoid emphasis processing across lines and fields in tables.

Emphasis processing could cause problems in tables, with spurious
matches for the emphasis regexp across field boundaries and even
lines.  Fixed now.
Carsten Dominik 17 年 前
コミット
b2842d2b7e
2 ファイル変更13 行追加3 行削除
  1. 4 2
      lisp/org-exp.el
  2. 9 1
      lisp/org-export-latex.el

+ 4 - 2
lisp/org-exp.el

@@ -2097,8 +2097,10 @@ This is to make sure that the line-processing export backends
 can work correctly."
   (goto-char (point-min))
   (while (re-search-forward org-emph-re nil t)
-    (if (not (= (char-after (match-beginning 3))
-		(char-after (match-beginning 4))))
+    (if (and (not (= (char-after (match-beginning 3))
+		     (char-after (match-beginning 4))))
+	     (save-excursion (goto-char (match-beginning 0))
+			     (save-match-data (not (org-at-table-p)))))
 	(org-if-unprotected
 	 (subst-char-in-region (match-beginning 0) (match-end 0)
 			       ?\n ?\  t)

+ 9 - 1
lisp/org-export-latex.el

@@ -1153,8 +1153,16 @@ The conversion is made depending of STRING-BEFORE and STRING-AFTER."
     ;; The match goes one char after the *string*
     (let ((emph (assoc (match-string 3)
 		       org-export-latex-emphasis-alist))
+	  (beg (match-beginning 0))
+	  (end (match-end 0))
 	  rpl)
-      (unless (get-text-property (1- (point)) 'org-protected)
+      (unless (or (get-text-property (1- (point)) 'org-protected)
+		  (save-excursion
+		    (goto-char (match-beginning 1))
+		    (save-match-data
+		      (and (org-at-table-p)
+			   (string-match
+			    "[|\n]" (buffer-substring beg end))))))
 	(setq rpl (concat (match-string 1)
 			  (format (org-export-latex-protect-char-in-string
 				   '("\\" "{" "}") (cadr emph))