With v4.1.2 but using SRE 5.0.0-rc.2. (This didn't look like an SRE issue but perhaps it is.)
Doing something like this:
import { document } from "./lib/shared/document.js";
import { RegisterHTMLHandler } from '@mathjax/src/js/handlers/html.js';
import { HTMLDocument } from '@mathjax/src/js/handlers/html/HTMLDocument.js';
import { liteAdaptor } from '@mathjax/src/js/adaptors/liteAdaptor.js';
const adaptor = liteAdaptor();
RegisterHTMLHandler(adaptor);
const htmlLite = new HTMLDocument('', adaptor);
import { mathjax } from '@mathjax/src/js/mathjax.js';
import '@mathjax/src/mjs/util/asyncLoad/esm.js';
import { MathML } from '@mathjax/src/js/input/mathml.js';
import { SVG } from '@mathjax/src/js/output/svg.js';
const mml = new MathML();
const svg = new SVG();
const mj = mathjax.document('', { InputJax: mml, OutputJax: svg });
const mml2svg = (mathstring, options) => mathjax.handleRetriesFor(() => mj.convert(mathstring, options));
const input = '';
let mjxLite;
try {
mjxLite = await mml2svg(input);
} catch (e) { console.log(e) };
document.body.innerHTML = adaptor.outerHTML(mjxLite);
with e.g. \ \widehat{\cdot }\ , SRE-enriched as
input
<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\ \widehat{\cdot }\ " data-semantic-type="punctuated" data-semantic-role="text" data-semantic-annotation="depth:1" data-semantic-id="7" data-semantic-children="0,3,4" data-semantic-attributes="latex:\ \widehat{\cdot }\ " data-semantic-collapsed="(7 (c 5 6) 0 3 4)" data-semantic-owns="0 3 4" data-semantic-structure="(7 0 (3 1 2) 4)" data-semantic-speech="ModifyingAbove dot With caret"><mtext data-latex="\ " data-semantic-type="text" data-semantic-role="space" data-semantic-annotation="clearspeak:unit;nemeth:number;depth:2" data-semantic-id="0" data-semantic-parent="7" data-semantic-attributes="latex:\ " data-semantic-speech=""> </mtext><mrow data-mjx-texclass="ORD" data-latex="\widehat{\cdot }"><mover data-semantic-type="overscore" data-semantic-role="multiplication" data-semantic-annotation="depth:2" data-semantic-embellished="operator" data-semantic-id="3" data-semantic-children="1,2" data-semantic-parent="7" data-semantic-attributes="latex:\widehat{\cdot };texclass:ORD" data-semantic-owns="1 2" data-semantic-speech="ModifyingAbove dot With caret"><mo data-mjx-texclass="BIN" data-latex="\cdot" data-semantic-type="operator" data-semantic-role="multiplication" data-semantic-annotation="nemeth:number;depth:3" data-semantic-id="1" data-semantic-parent="3" data-semantic-attributes="latex:\cdot;texclass:BIN" data-semantic-speech="dot" data-semantic-prefix="Base">⋅</mo><mo data-semantic-type="punctuation" data-semantic-role="overaccent" data-semantic-annotation="accent:overaccent;depth:3" data-semantic-id="2" data-semantic-parent="3" data-semantic-speech="caret" data-semantic-prefix="Overscript">^</mo></mover></mrow><mtext data-latex="\ " data-semantic-type="text" data-semantic-role="space" data-semantic-annotation="clearspeak:unit;nemeth:number;depth:2" data-semantic-id="4" data-semantic-parent="7" data-semantic-attributes="latex:\ " data-semantic-speech=""> </mtext></math>
gives me the following error
TypeError: Cannot read properties of undefined (reading 'attributes')
at LiteAdaptor.hasAttribute (file://[snip]/node_modules/@mathjax/src/mjs/adaptors/liteAdaptor.js:341:35)
at SvgMspace.handleAttributes (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrapper.js:267:30)
at SvgMspace.standardSvgNodes (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrapper.js:56:14)
at SvgMspace.toSVG (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrapper.js:13:31)
at SvgInferredMrowNTD.addChildren (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrappers/mrow.js:71:27)
at SvgInferredMrowNTD.toSVG (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrappers/mrow.js:19:22)
at SvgTeXAtom.addChildren (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrapper.js:42:19)
at SvgTeXAtom.toSVG (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrapper.js:13:14)
at SvgTeXAtom.toSVG (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrappers/TeXAtom.js:10:23)
at SvgTeXAtom.toEmbellishedSVG (file://[snip]/node_modules/@mathjax/src/mjs/output/svg/Wrapper.js:28:22)
file://[snip]/node_modules/@mathjax/src/mjs/adaptors/liteAdaptor.js:294
return node.kind;
^
TypeError: Cannot read properties of undefined (reading 'kind')
at LiteAdaptor.kind (file://[snip]/node_modules/@mathjax/src/mjs/adaptors/liteAdaptor.js:294:21)
at LiteParser.serialize (file://[snip]/node_modules/@mathjax/src/mjs/adaptors/lite/Parser.js:153:29)
at LiteAdaptor.outerHTML (file://[snip]/node_modules/@mathjax/src/mjs/adaptors/liteAdaptor.js:317:28)
at file://[snip]/lite.js:29:35
Node.js v25.2.1
The same happens with:
\mathtt{v}:F_{\operatorname {nr}}^\times /n{\;\overset{\sim }{\longrightarrow }\;}\Gamma _{F_{\operatorname {nr}}}/n=\Gamma _F/n
{\mathbb{T}}_L {\, \stackrel{\mathrm{def}}{=}\, }{\mathbb{R}}^n/L
With v4.1.2 but using SRE 5.0.0-rc.2. (This didn't look like an SRE issue but perhaps it is.)
Doing something like this:
with e.g.
\ \widehat{\cdot }\, SRE-enriched asinput
<math xmlns="http://www.w3.org/1998/Math/MathML" data-latex="\ \widehat{\cdot }\ " data-semantic-type="punctuated" data-semantic-role="text" data-semantic-annotation="depth:1" data-semantic-id="7" data-semantic-children="0,3,4" data-semantic-attributes="latex:\ \widehat{\cdot }\ " data-semantic-collapsed="(7 (c 5 6) 0 3 4)" data-semantic-owns="0 3 4" data-semantic-structure="(7 0 (3 1 2) 4)" data-semantic-speech="ModifyingAbove dot With caret"><mtext data-latex="\ " data-semantic-type="text" data-semantic-role="space" data-semantic-annotation="clearspeak:unit;nemeth:number;depth:2" data-semantic-id="0" data-semantic-parent="7" data-semantic-attributes="latex:\ " data-semantic-speech=""> </mtext><mrow data-mjx-texclass="ORD" data-latex="\widehat{\cdot }"><mover data-semantic-type="overscore" data-semantic-role="multiplication" data-semantic-annotation="depth:2" data-semantic-embellished="operator" data-semantic-id="3" data-semantic-children="1,2" data-semantic-parent="7" data-semantic-attributes="latex:\widehat{\cdot };texclass:ORD" data-semantic-owns="1 2" data-semantic-speech="ModifyingAbove dot With caret"><mo data-mjx-texclass="BIN" data-latex="\cdot" data-semantic-type="operator" data-semantic-role="multiplication" data-semantic-annotation="nemeth:number;depth:3" data-semantic-id="1" data-semantic-parent="3" data-semantic-attributes="latex:\cdot;texclass:BIN" data-semantic-speech="dot" data-semantic-prefix="Base">⋅</mo><mo data-semantic-type="punctuation" data-semantic-role="overaccent" data-semantic-annotation="accent:overaccent;depth:3" data-semantic-id="2" data-semantic-parent="3" data-semantic-speech="caret" data-semantic-prefix="Overscript">^</mo></mover></mrow><mtext data-latex="\ " data-semantic-type="text" data-semantic-role="space" data-semantic-annotation="clearspeak:unit;nemeth:number;depth:2" data-semantic-id="4" data-semantic-parent="7" data-semantic-attributes="latex:\ " data-semantic-speech=""> </mtext></math>gives me the following error
The same happens with:
\mathtt{v}:F_{\operatorname {nr}}^\times /n{\;\overset{\sim }{\longrightarrow }\;}\Gamma _{F_{\operatorname {nr}}}/n=\Gamma _F/n{\mathbb{T}}_L {\, \stackrel{\mathrm{def}}{=}\, }{\mathbb{R}}^n/L