Skip to content

[BUG] Math html fails to parse #1483

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
shakilhossain38 opened this issue May 8, 2025 · 0 comments
Open

[BUG] Math html fails to parse #1483

shakilhossain38 opened this issue May 8, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@shakilhossain38
Copy link

shakilhossain38 commented May 8, 2025

**When the data includes complex math equations, it fails to parse the equations **

Sample data

const _htmlContent = '''<b>গ. Y এর মান সত্যক সারনিতে দেখাও।</b>\nগ.<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mtable columnalign=\"right left\" columnspacing=\"0em\" rowspacing=\"0.25em\"><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mi mathvariant=\"bold\">Y</mi></mstyle></mtd><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mrow></mrow><mo>=</mo><mover accent=\"true\"><mrow><mi>A</mi><mo>+</mo><mover accent=\"true\"><mi>B</mi><mo>ˉ</mo></mover></mrow><mo stretchy=\"true\">‾</mo></mover><mo>+</mo><mover accent=\"true\"><mrow><mi>A</mi><mo>+</mo><mover accent=\"true\"><mi>B</mi><mo>ˉ</mo></mover></mrow><mo stretchy=\"true\">‾</mo></mover></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mrow></mrow><mo>=</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mover accent=\"true\"><mover accent=\"true\"><mi>B</mi><mo>ˉ</mo></mover><mo stretchy=\"true\">‾</mo></mover><mo>+</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mover accent=\"true\"><mover accent=\"true\"><mi>B</mi><mo>ˉ</mo></mover><mo stretchy=\"true\">‾</mo></mover></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mrow></mrow><mo>=</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mo>⋅</mo><mi mathvariant=\"normal\">B</mi><mo>+</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mo>⋅</mo><mi mathvariant=\"normal\">B</mi></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mrow></mrow><mo>=</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mo>⋅</mo><mi mathvariant=\"normal\">B</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding=\"application/x-tex\"> \\begin{aligned} \\mathbf{Y} &amp; =\\overline{A+\\bar{B}}+\\overline{A+\\bar{B}} \\\\ &amp; =\\bar{A} \\overline{\\bar{B}}+\\bar{A} \\overline{\\bar{B}} \\\\ &amp; =\\bar{A} \\cdot \\mathrm{B}+\\bar{A} \\cdot \\mathrm{B} \\\\ &amp; =\\bar{A} \\cdot \\mathrm{B} \\end{aligned} </annotation></semantics></math>\n<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mrow><mi mathvariant=\"bold\">Y</mi><mo>=</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mrow><mtext> </mtext><mi mathvariant=\"normal\">B</mi></mrow></mrow><annotation encoding=\"application/x-tex\"> \\mathbf{Y}=\\bar{A} \\mathrm{~B} </annotation></semantics></math> এর সত্যক সারণি নিচে দেওয়া হলো\n<img class=\"mx-auto bg-gray-100 rounded-lg my-2 max-h-96 object-contain\" height=\"auto\" src=\"https://assets.chorcha.net/1H56cYQklMSC2i53pUEK-.png\" width=\"256\"/><math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mtable columnalign=\"right left\" columnspacing=\"0em\" rowspacing=\"0.25em\"><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow></mrow></mstyle></mtd></mtr><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow></mrow></mstyle></mtd><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mrow></mrow><mo>=</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mover accent=\"true\"><mover accent=\"true\"><mi>B</mi><mo>ˉ</mo></mover><mo stretchy=\"true\">‾</mo></mover><mo>+</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mover accent=\"true\"><mover accent=\"true\"><mi>B</mi><mo>ˉ</mo></mover><mo stretchy=\"true\">‾</mo></mover></mrow></mstyle></mtd></mtr></mtable><annotation encoding=\"application/x-tex\"> \\begin{aligned} \\\\ &amp; =\\bar{A} \\overline{\\bar{B}}+\\bar{A} \\overline{\\bar{B}} \\end{aligned} </annotation></semantics></math> →\n<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mtable columnalign=\"right\" columnspacing=\"\" rowspacing=\"0.25em\"><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mo>=</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mo>⋅</mo><mi mathvariant=\"normal\">B</mi><mo>+</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mo>⋅</mo><mi mathvariant=\"normal\">B</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding=\"application/x-tex\"> \\begin{aligned} =\\bar{A} \\cdot \\mathrm{B}+\\bar{A} \\cdot \\mathrm{B}\\end{aligned} </annotation></semantics></math> →\n<math xmlns=\"http://www.w3.org/1998/Math/MathML\"><semantics><mtable columnalign=\"right\" columnspacing=\"\" rowspacing=\"0.25em\"><mtr><mtd><mstyle displaystyle=\"true\" scriptlevel=\"0\"><mrow><mo>=</mo><mover accent=\"true\"><mi>A</mi><mo>ˉ</mo></mover><mo>⋅</mo><mi mathvariant=\"normal\">B</mi></mrow></mstyle></mtd></mtr></mtable><annotation encoding=\"application/x-tex\"> \\begin{aligned}=\\bar{A} \\cdot \\mathrm{B} \\end{aligned} </annotation></semantics></math> →\n\n''';

@shakilhossain38 shakilhossain38 added the bug Something isn't working label May 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant