Skip to content

Uncaught DOMException: Element.querySelector: '#3-1-some-title-level-3' is not a valid selector #92

@bitonio

Description

@bitonio

Hello,

First, thanks for this plugin.
I have some user generated Markdown converted to HTML with heading, without specifying the ID.
The anchor generated by this plugin are friendly although if the heading starts with a digit, like

<h3> 3.1 Some title level 3</h3>

It will generate an id/anchor 3-1-some-title-level-3
This is not supported by querySelector.

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id

Similarly, an id starting with a digit (E.g., 1234-322-678) or a hyphen followed by a digit (E.g., -123), though valid in HTML, may lead to problems when used in CSS, JavaScript, and Web APIs

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