That Sigil ignores that namespace makes no sense. Adding the mathml namespace prefix "math" to the html tag and then using that prefix "math" for each math tag in the file (ie. each tag becomes math:math) should work. That is what namespace prefixes are for.
More importantly though math tags do NOT need a prefix at all under the html5 xhtml variant used for epub3 according to the spec. The math tag and its contents is autorecognized as a foreign tag (just like the svg tag) and modern parsers should understand it just fine without the need for declaring any namespace prefix for it.
Have you tried without any specific namespace prefix defined for mathml at all?
I wonder if this is a limitation of Qt6's webengine's new built in mathml support in some way?
Update: It is not. To test with Sigil I opened an epub full of mathml and did a global find and replace to remove all of the math tag namespace declarations that said no prefix needed:
ie:
xmlns="http://www.w3.org/1998/Math/MathML"
and made sure no mathml prefix namespace was defined on the html tag.
And sure enough no parsing errors or problems at all. All equations looked as expected.
So no math namespace prefix need be defined and no xmlns="http://www.w3.org/1998/Math/MathML" need be added to math tags as it is properly namespaced by the parser under the html5 xhtml variant used by epubs and by browser engines.
Not sure what problems you are seeing under Sigil.
Last edited by KevinH; 03-07-2025 at 06:31 PM.
|