Show:
new DOMNormalizer(state)
...
Methods
merge()
Transfer all of b's children to a and delete b.
Transfer all of b's children to a and delete b.
- Source:
normalizeNode(node) → {Node}
scrubWikitext normalizations implemented right now:
- Tag minimization (I/B tags) in normalizeSiblingPair
- Strip empty headings and style tags
- Force SOL transparent links to serialize before/after heading
- Trailing spaces are migrated out of links
- Space is added before escapable prefixes in table cells
- Strip
from headings - Strip bidi chars around categories
- When an A tag is encountered, if there are format tags inside, move them outside
The return value from this function should respect the following contract:
- if input node is unmodified, return it.
scrubWikitext normalizations implemented right now:
- Tag minimization (I/B tags) in normalizeSiblingPair
- Strip empty headings and style tags
- Force SOL transparent links to serialize before/after heading
- Trailing spaces are migrated out of links
- Space is added before escapable prefixes in table cells
- Strip
from headings - Strip bidi chars around categories
- When an A tag is encountered, if there are format tags inside, move them outside
The return value from this function should respect the following contract:
- if input node is unmodified, return it.
- if input node is modified, return the new node that it transforms into. If you return a node other than this, normalizations may not apply cleanly and may be skipped.
Parameters:
Name | Type | Description |
---|---|---|
node |
Node | the node to normalize |
- Source:
Returns:
the normalized node
- Type
- Node
swap()
b is a's sole non-deleted child.
b is a's sole non-deleted child. Switch them around.
- Source: