Skip to content
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

[3.1.3] liteAdaptor does not close SVG path elements #2674

Closed
pkra opened this issue Apr 23, 2021 · 2 comments
Closed

[3.1.3] liteAdaptor does not close SVG path elements #2674

pkra opened this issue Apr 23, 2021 · 2 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3
Milestone

Comments

@pkra
Copy link
Contributor

pkra commented Apr 23, 2021

E.g., using https://github.com/mathjax/MathJax-demos-node/blob/master/direct/tex2svg-page and

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Hello</title>
</head>
<body>
\(\alpha\)
</body>
</html>

the result ends with

...
<svg style="display: none" id="MJX-SVG-global-cache"><defs><path id="MJX-TEX-I-1D6FC" d="M34 156Q34 270 120 356T309 442Q379 442 421 402T478 304Q484 275 485 237V208Q534 282 560 374Q564 388 566 390T582 393Q603 393 603 385Q603 376 594 346T558 261T497 161L486 147L487 123Q489 67 495 47T514 26Q528 28 540 37T557 60Q559 67 562 68T577 70Q597 70 597 62Q597 56 591 43Q579 19 556 5T512 -10H505Q438 -10 414 62L411 69L400 61Q390 53 370 41T325 18T267 -2T203 -11Q124 -11 79 39T34 156ZM208 26Q257 26 306 47T379 90L403 112Q401 255 396 290Q382 405 304 405Q235 405 183 332Q156 292 139 224T121 120Q121 71 146 49T208 26Z"></defs></svg>
</body>

Note that the path element is not closed.

When there are many (many) paths (e.g., the test file for mathjax-unicode-math), WebKit won't render the paths and Blink even crashes.

@pkra
Copy link
Contributor Author

pkra commented Apr 23, 2021

(The jsdom adaptor appears fine as a workaround.)

@dpvc
Copy link
Member

dpvc commented Apr 23, 2021

I've made a PR for it.

@dpvc dpvc added Accepted Issue has been reproduced by MathJax team Ready for Review Test Needed v3 labels Apr 23, 2021
dpvc added a commit to mathjax/MathJax-src that referenced this issue Apr 23, 2021
Fix problem with not closing empty tags in HTML serialization (mathjax/MathJax#2674)
@dpvc dpvc added this to the 3.1.3 milestone Apr 29, 2021
@dpvc dpvc closed this as completed Apr 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Needed v3
Projects
None yet
Development

No branches or pull requests

2 participants