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



Reply via email to