fedilab-Android-App/mathjaxandroid/src/main/assets/MathJaxAndroid/MathJax/extensions/MathML/mml3.js

20 lines
21 KiB
JavaScript
Raw Normal View History

2023-01-16 13:56:25 +01:00
/*
* /MathJax/extensions/MathML/mml3.js
*
* Copyright (c) 2009-2015 The MathJax Consortium
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
MathJax.Extension["MathML/mml3"]={version:"2.5.1"};MathJax.Hub.Register.StartupHook("MathML Jax Ready",function(){var c=MathJax.InputJax.MathML,e=c.Parse.prototype;c.prefilterHooks.Add(function(h){if(!c.mml3XSLT){return}if(!c.ParseXML){c.ParseXML=c.createParser()}var i=c.ParseXML(e.preProcessMath(h.math));var g=c.mml3XSLT.transformToDocument(i);if((typeof g)==="string"){h.math=g}else{if(window.XMLSerializer){var f=new XMLSerializer();h.math=f.serializeToString(g.documentElement,i)}}});var d='<x:stylesheet version="1.0" xmlns:x="http://www.w3.org/1999/XSL/Transform" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns="http://www.w3.org/1998/Math/MathML" xmlns:c="http://exslt.org/common" exclude-result-prefixes="m c"><ms:script language="JScript" implements-prefix="c" xmlns:ms="urn:schemas-microsoft-com:xslt"> this[\'node-set\'] = function (x) { return x; }</ms:script><x:output indent="yes" omit-xml-declaration="yes"/><x:template match="*"><x:copy><x:copy-of select="@*"/><x:apply-templates/></x:copy></x:template><x:template match="*[@dir=\'rtl\']" priority="10"><x:apply-templates mode="rtl" select="."/></x:template><x:template match="@*" mode="rtl"><x:copy-of select="."/></x:template><x:template match="*" mode="rtl"><x:copy><x:apply-templates select="@*" mode="rtl"/><x:for-each select="node()"><x:sort data-type="number" order="descending" select="position()"/><x:text></x:text><x:apply-templates mode="rtl" select="."/></x:for-each></x:copy></x:template><x:template match="@open" mode="rtl"><x:attribute name="close"><x:value-of select="."/></x:attribute></x:template><x:template match="@open[.=\'(\']" mode="rtl"><x:attribute name="close">)</x:attribute></x:template><x:template match="@open[.=\')\']" mode="rtl"><x:attribute name="close">(</x:attribute></x:template><x:template match="@open[.=\'[\']" mode="rtl"><x:attribute name="close">]</x:attribute></x:template><x:template match="@open[.=\']\']" mode="rtl"><x:attribute name="close">[</x:attribute></x:template><x:template match="@open[.=\'{\']" mode="rtl"><x:attribute name="close">}</x:attribute></x:template><x:template match="@open[.=\'}\']" mode="rtl"><x:attribute name="close">{</x:attribute></x:template><x:template match="@close" mode="rtl"><x:attribute name="open"><x:value-of select="."/></x:attribute></x:template><x:template match="@close[.=\'(\']" mode="rtl"><x:attribute name="open">)</x:attribute></x:template><x:template match="@close[.=\')\']" mode="rtl"><x:attribute name="open">(</x:attribute></x:template><x:template match="@close[.=\'[\']" mode="rtl"><x:attribute name="open">]</x:attribute></x:template><x:template match="@close[.=\']\']" mode="rtl"><x:attribute name="open">[</x:attribute></x:template><x:template match="@close[.=\'{\']" mode="rtl"><x:attribute name="open">}</x:attribute></x:template><x:template match="@close[.=\'}\']" mode="rtl"><x:attribute name="open">{</x:attribute></x:template><x:template match="m:mfrac[@bevelled=\'true\']" mode="rtl"><mrow><msub><mi></mi><x:apply-templates select="*[2]" mode="rtl"/></msub><mo>&#x5c;</mo><msup><mi></mi><x:apply-templates select="*[1]" mode="rtl"/></msup></mrow></x:template><x:template match="m:mfrac" mode="rtl"><x:copy><x:apply-templates mode="rtl" select="@*|*"/></x:copy></x:template><x:template match="m:mroot" mode="rtl"><msup><menclose notation="top right"><x:apply-templates mode="rtl" select="@*|*[1]"/></menclose><x:apply-templates mode="rtl" select="*[2]"/></msup></x:template><x:template match="m:msqrt" mode="rtl"><menclose notation="top right"><x:apply-templates mode="rtl" select="@*|*[1]"/></menclose></x:template><x:template match="m:mtable|m:munder|m:mover|m:munderover" mode="rtl" priority="2"><x:copy><x:apply-templates select="@*" mode="rtl"/><x:apply-templates mode="rtl"></x:apply-templates></x:copy></x:template><x:template match="m:msup" mode="rtl" priority="2"><mmultiscripts><x:apply-templates select="*[1]" mode="rtl"/><mprescripts/><none/><x:apply-templates select="*[2]" mode="rtl"/></mmultiscripts></x:template><x:template match="m:msub" mode="rtl" priority="2"><mmultiscripts><x:apply-templates sel