Skip to content

Support Custom HTML Element #6675

@uwni

Description

@uwni

Description

Custom HTML Element

Custom HTML Element1 is introduced in HTML5, which allows user to create their own custom html element like

<my-custom-tag> </my-custom-tag>

Use Case

it will be useful with the Typst html output feature (especially with html.elem), one can use it as a placeholder and do more post-processing in further process. for example, the

#html.elem("my-custom-tag")

will produce <my-custom-tag> mentioned above. and one can use 3-rd party tools to replace it with html contents.2

However, currently, it is blocked by the naming check, the character "-" is not valid in a tag name error will be reported if you try to do this.

Footnotes

  1. https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name

  2. Although you can use <div> even <slot> with id or name attribute identifier, as a placeholder. but the custom elements are also necessary in my opinion

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions