소스 검색

Relax the match criteria for MathML header line

* lisp/org.el (org-create-math-formula): Allow the xmlns attribute to
  be preceded by any other mathml header attribute.

The problem here was that the match criteria for MathML assumed that
the xmlns attribute is the first listed in the top level MathML <math>
element.  Some LaTeX -> MathML converters (e.g., pandoc) will add
attributes before xmlns, which is still valid MathML.
Lixin Chin 9 년 전
부모
커밋
f5916c4fbb
1개의 변경된 파일3개의 추가작업 그리고 6개의 파일을 삭제
  1. 3 6
      lisp/org.el

+ 3 - 6
lisp/org.el

@@ -19386,12 +19386,9 @@ inspection."
 	    (with-current-buffer (find-file-noselect tmp-out-file t)
 	      (goto-char (point-min))
 	      (when (re-search-forward
-		     (concat
-		      (regexp-quote
-		       "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"")
-		      "[^>]*?>"
-		      "\\(.\\|\n\\)*"
-		      "</math>")
+		     (format "<math[^>]*?%s[^>]*?>\\(.\\|\n\\)*</math>"
+			     (regexp-quote
+			      "xmlns=\"http://www.w3.org/1998/Math/MathML\""))
 		     nil t)
 		(prog1 (match-string 0) (kill-buffer))))))
     (cond