You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pasting MathML into Word does not consistently result in a Microsoft Math Object; instead, the raw MathML code is sometimes displayed in the document. This inconsistency seems to depend on both the clipboard format type(s) of the clipboard content and whether or not the <math> tag includes the MathML namespace.
The MathML only becomes a Microsoft Math Object when both of the following are true:
The clipboard contains just the text/plain format of MathML code
The <math> tag includes the MathML namespace (xmlns="http://www.w3.org/1998/Math/MathML").
Otherwise, the result is visible MathML code in the document. For example, if the clipboard contains both the text/plain and text/html clipboard format types the MathML code is pasted in as formatted text.
Expected Behavior
When MathML is pasted into a Word Document, it is desirable to have it automatically converted into a built-up Microsoft Math Object regardless of the format types available on the clipboard and regardless of if/how the MathML is namespaced. Then if the user meant to keep the raw MathML code, the Paste Options Menu could be used to have it pasted in as another option (keep text only, merge formatting, keep source formatting, etc.).
Reasoning for Ignoring the xmlsns Attribute
Tools like MathJax, MathCAT in NVDA, and the JAWS Math Viewer allow users to copy math expressions as MathML but they do not always supply an xmlns attribute nor do they ensure the xmlns attribute value that they sometimes supply is correct.
MathML used in HTML5 does not have to declare a namespace as the HTML parser has in-built knowledge of the HTML, SVG and MathML namespaces. While the xmlns attribute may be used on the math element, it will be ignored by the HTML parser.[1]. Since web user agents ignore the xmlns attribute on math elements and web pages are the most prolific source of digital content, then it is quite reasonable to expect that users will be frequently copying MathML from sources that are either not namespaced or have incorrect xmlns values.
Explore the page to find some math. For example, the first expression after the heading "The Light Cone".
Invoke the MathJax menu, then Show math as, then MathML code. You can also choose Original MathML code.
A new window opens displaying the MathML. Copy the content of this window to the clipboard.
Switch to Word and paste the math. It is not converted into an Office Math expression.
Switch to Notepad and paste the clipboard into a new document. Prepend http: to the value at the beginning of the xmls attribute on the first line. So <math xmlns="//www.w3.org/1998/Math/MathML becomes <math xmlns="http://www.w3.org/1998/Math/MathML"
Copy the text to the clipboard. Switch to the Word document and paste the content of the clipboard. The math is detected and converted to Office Math.
MathML Copied Using JAWS's Math Viewer (lacks the xmlns attribute)
Open Microsoft Word 365 (Desktop version) on Windows 11.
Create a new [blank] document.
Launch JAWS
Use the Early Adopter Program dialog to ensure that MathCAT is enabled.
Dialog is available from "Options" > "Early Adopter Program..."
Restart JAWS if necessary
Visit a web page that contains math expressions encoded as MathML
Press "Ctrl+V" to paste the math expression into the Word document
Note that instead of a Microsoft Math Object that represents the expression copied in step 8, that the raw MathML for the expression was pasted in as plain text.
Also note that the MathML that was pasted in does not have a xmlns='http://www.w3.org/1998/Math/MathML' attribute on the <math> element.
The text was updated successfully, but these errors were encountered:
brichwin
changed the title
Ensure MathML Pasted from Various Sources Converts to Microsoft Math Objects in Word
MathML Pasted from Various Sources Inconsistently Converts to Microsoft Math Objects in Word
Sep 23, 2024
eDAD tracking ticket for this issue is Accessibility 230603
Consolidated Issue
This issue consolidates the following issues:
Description
Pasting MathML into Word does not consistently result in a Microsoft Math Object; instead, the raw MathML code is sometimes displayed in the document. This inconsistency seems to depend on both the clipboard format type(s) of the clipboard content and whether or not the
<math>
tag includes the MathML namespace.The MathML only becomes a Microsoft Math Object when both of the following are true:
text/plain
format of MathML code<math>
tag includes the MathML namespace (xmlns="http://www.w3.org/1998/Math/MathML"
).Otherwise, the result is visible MathML code in the document. For example, if the clipboard contains both the
text/plain
andtext/html
clipboard format types the MathML code is pasted in as formatted text.Expected Behavior
When MathML is pasted into a Word Document, it is desirable to have it automatically converted into a built-up Microsoft Math Object regardless of the format types available on the clipboard and regardless of if/how the MathML is namespaced. Then if the user meant to keep the raw MathML code, the Paste Options Menu could be used to have it pasted in as another option (keep text only, merge formatting, keep source formatting, etc.).
Reasoning for Ignoring the
xmlsns
AttributeTools like MathJax, MathCAT in NVDA, and the JAWS Math Viewer allow users to copy math expressions as MathML but they do not always supply an
xmlns
attribute nor do they ensure thexmlns
attribute value that they sometimes supply is correct.MathML used in HTML5 does not have to declare a namespace as the HTML parser has in-built knowledge of the HTML, SVG and MathML namespaces. While the
xmlns
attribute may be used on the math element, it will be ignored by the HTML parser.[1]. Since web user agents ignore thexmlns
attribute onmath
elements and web pages are the most prolific source of digital content, then it is quite reasonable to expect that users will be frequently copying MathML from sources that are either not namespaced or have incorrectxmlns
values.[1] Retrieved from: 2.1.2 MathML and Namespaces - Mathematical Markup Language (MathML) Version 4.0 https://www.w3.org/TR/mathml4/#interf_namespace on September 23, 2024 on September 23, 2024.
Steps to reproduce
MathML Copied Using MathJax (lacks "proper"
xmlns
value for MathML and clipboard includestext/html
data)Show math as
, thenMathML code
. You can also chooseOriginal MathML code
.http:
to the value at the beginning of thexmls
attribute on the first line. So<math xmlns="//www.w3.org/1998/Math/MathML
becomes<math xmlns="http://www.w3.org/1998/Math/MathML"
MathML Copied Using JAWS's Math Viewer (lacks the
xmlns
attribute)xmlns='http://www.w3.org/1998/Math/MathML'
attribute on the<math>
element.The text was updated successfully, but these errors were encountered: