Skip to content

Mathematics node bloats the largest chunk including katex twice #8333

@max-nextcloud

Description

@max-nextcloud

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-katex will 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 the katex dependency.

  • Make sure to lazy load katex our in the node view only if latex is actually used on the page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions