[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[O] [PATCH] org.el: Relax the match criteria for MathML header line
From: |
Lixin Chin |
Subject: |
[O] [PATCH] org.el: Relax the match criteria for MathML header line |
Date: |
Tue, 29 Nov 2016 11:45:49 +0800 |
User-agent: |
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.5.0 |
Hi everyone,
This fixes a minor bug in converting LaTeX equations to MathML. The
default match criteria for the toplevel <math> is unnecessarily strict,
and should probably be relaxed.
Thanks,
Lixin Chin
* 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.
---
lisp/org.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/org.el b/lisp/org.el
index e372475..93d00ac 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -19387,8 +19387,9 @@ inspection."
(goto-char (point-min))
(when (re-search-forward
(concat
+ "<math[^>]*?"
(regexp-quote
- "<math xmlns=\"http://www.w3.org/1998/Math/MathML\"")
+ "xmlns=\"http://www.w3.org/1998/Math/MathML\"")
"[^>]*?>"
"\\(.\\|\n\\)*"
"</math>")
--
2.10.2
- [O] [PATCH] org.el: Relax the match criteria for MathML header line,
Lixin Chin <=