I
ParseRule
A rule for parsing DOM (paste / HTML import) into a block or mark. `getAttrs` receives a real `HTMLElement` (only ever called by the view); the type reference is compile-time only and introduces no runtime DOM dependency.
Signature
ts
interface ParseRuleProperties
| Property | Type | Description |
|---|---|---|
tag?readonly | string | undefined | CSS selector to match, e.g. `'a[href]'`, `'strong'`, `'h1'`. |
style?readonly | string | undefined | Inline-style match, e.g. `'font-weight=700'` (reserved for M2). |
attrs?readonly | Readonly<Record<string, import("..").AttrValue>> | undefined | Static attrs applied when the rule matches. |
getAttrs?readonly | ((el: HTMLElement) => Attrs | false | null) | undefined | Derive attrs from the matched element; `false`/`null` rejects the match. |
priority?readonly | number | undefined | Higher priority rules are tried first. |