Diffdown is a real-time collaborative Markdown editor/previewer built on the AT Protocol
diffdown.com
1# @lezer/html
2
3This is an HTML grammar for the
4[lezer](https://lezer.codemirror.net/) parser system.
5
6The code is licensed under an MIT license.
7
8## Interface
9
10This package exports two bindings:
11
12**`parser`**`: Parser`
13
14The parser instance for the basic HTML grammar. Supports two dialects:
15
16 - `"noMatch"` turns off tag matching, creating regular syntax nodes
17 even for mismatched tags.
18
19 - `"selfClosing"` adds support for `/>` self-closing tag syntax.
20
21**`configureNesting`**`(tags?: {`\
22` tag: string,`\
23` attrs?: (attrs: {[attr: string]: string}) => boolean,`\
24` parser: Parser,`\
25`}[], attributes?: {`\
26` name: string,`\
27` tagName?: string,`\
28` parser: Parser,`\
29`}[]): ParseWrapper`
30
31Create a nested parser config object which overrides the way the
32content of some tags or attributes is parsed. Each tag override is an
33object with a `tag` property holding the (lower case) tag name to
34override, and an optional `attrs` predicate that, if given, has to
35return true for the tag's attributes for this override to apply.
36
37The `parser` property describes the way the tag's content is parsed.