Skip to content

MathML and SVG tags considered non-native by parser #258

Open

Description

For a while, I've been getting Vue warnings about failure to resolve MathML tags during rendering with MDC. Initially I tried to set compilerOptions.isCustomElement to suppress the warnings but it seemed ignored when used with MDC (#250).

Vue added support for MathML tags all the way back in 3.4, and Katex's output seemed to be correct, so it has to come from MDC.

It seems to come from here:

// Check if node is not a native HTML tag
if (!htmlTags.includes(component) && !component?.render && !component?.ssrRender) {
const componentFn = resolveComponent(pascalCase(component), false)

due to MathML tags not being included in htmlTags, thus the component tries to resolve it as a Vue component.

I'm willing to create a PR if all it requires is adding the MathML tags to runtime/parser/utils/html-tags-list.ts.

EDIT: this also affects the <line> and <path> tags used by inline SVGs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions