Mathematics node bloats the largest chunk including katex twice
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 659
- Forks
- 133
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 110
Description
Describe the bug
The current mathematics implementation imports katex three times:
-
via
@tiptap/extension-mathematics -
via
markdown-it-katex -
directly.
-
We add a custom node view so the katex part in the tiptap extension never gets used - it's imported never the less.
-
Markdown-it-katexwill render the latex and then we extract its source from the annotation tag.
We could avoid the entire rendering in the first place and thus also thekatexdependency. -
Make sure to lazy load katex our in the node view only if latex is actually used on the page.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the mathematics implementation, custom node view, and the three KaTeX imports described in the issue. Inspect the generated largest chunk and the node-view loading path. Done means the duplicate KaTeX imports are removed and KaTeX is loaded only when mathematics is used, without changing rendering behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100