summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLixin Chin <lixinchin@gmail.com>2016-11-29 09:28:06 +0100
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2016-11-29 09:28:06 +0100
commitf5916c4fbb6cd859b179b90489f2eb5b8da65e33 (patch)
treedace744f6fea42167aaf3d8c9f787fe3cb0f9a7a
parent73694b21d7233c88bbd6e67eefaf8f4c321e4863 (diff)
downloadorg-mode-f5916c4fbb6cd859b179b90489f2eb5b8da65e33.tar.gz
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.
-rw-r--r--lisp/org.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/org.el b/lisp/org.el
index e372475..5763829 100644
--- a/lisp/org.el
+++ b/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