-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace parse5 with htmlparser2 for diffable formatter (#80)
* Update Deps * move parser to helpers * Fix SVG tests * Fix entity encoding tests * Stubbed component tests * Types * Bump * " fix * clipPath svg map * Include style/script tags in formatter * escapeAttributes * Volta
- Loading branch information
1 parent
01fb0b0
commit 83ab078
Showing
11 changed files
with
417 additions
and
202 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/** | ||
* @file Constants and large object generation/storage. | ||
*/ | ||
|
||
const SVG_FILTER_TAGS = Object.freeze([ | ||
'feBlend', | ||
'feColorMatrix', | ||
'feComponentTransfer', | ||
'feComposite', | ||
'feConvolveMatrix', | ||
'feDiffuseLighting', | ||
'feDisplacementMap', | ||
'feDistantLight', | ||
'feDropShadow', | ||
'feFlood', | ||
'feFuncA', | ||
'feFuncB', | ||
'feFuncG', | ||
'feFuncR', | ||
'feGaussianBlur', | ||
'feImage', | ||
'feMerge', | ||
'feMergeNode', | ||
'feMorphology', | ||
'feOffset', | ||
'fePointLight', | ||
'feSpecularLighting', | ||
'feSpotLight', | ||
'feTile', | ||
'feTurbulence' | ||
]); | ||
|
||
export const lowerToUppercaseSvgTagNames = { | ||
clippath: 'clipPath' | ||
}; | ||
for (const svgTagName of SVG_FILTER_TAGS) { | ||
lowerToUppercaseSvgTagNames[svgTagName.toLowerCase()] = svgTagName; | ||
} | ||
|
||
export const SELF_CLOSING_SVG_ELEMENTS = Object.freeze([ | ||
'circle', | ||
'ellipse', | ||
...SVG_FILTER_TAGS, | ||
'line', | ||
'path', | ||
'polygon', | ||
'polyline', | ||
'rect', | ||
'stop', | ||
'use' | ||
]); | ||
|
||
// From https://developer.mozilla.org/en-US/docs/Glossary/Void_element | ||
export const VOID_ELEMENTS = Object.freeze([ | ||
'area', | ||
'base', | ||
'br', | ||
'col', | ||
'embed', | ||
'hr', | ||
'img', | ||
'input', | ||
'link', | ||
'meta', | ||
'param', | ||
'source', | ||
'track', | ||
'wbr' | ||
]); | ||
|
||
export const ESCAPABLE_RAW_TEXT_ELEMENTS = Object.freeze([ | ||
'textarea', | ||
'title' | ||
]); |
Oops, something went wrong.