Skip to content

Missing endTag source location information on SVG elements with uppercased tag name #352

@pmdartus

Description

@pmdartus

Description

Parse5 doesn't report endTag source location for all the SVG elements with a tag name containing an upper case even when the end tag is present. eg: foreignObject, `linearGradient, etc.

Repro steps

const html = '<svg><foreignObject></foreignObject></svg>';
const fragment = parse5.parseFragment(html, {
  sourceCodeLocationInfo: true
});

const foreignObject = fragment.children[0].children[0];
console.log(foreignObject.sourceCodeLocation.endTag);

// Actual: undefined
// Expected: { startLine: 1, startCol: 21, startOffset: 20, endLine: 1, endCol: 37, endOffset: 36 }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions