export const htmlElements = [
'a',
'abbr',
'address',
'area',
'article',
'aside',
'audio',
'b',
'bdi',
'bdo',
'blockquote',
'br',
'button',
'caption',
'cite',
'code',
'col',
'colgroup',
'data',
'datalist',
'dd',
'del',
'details',
'dfn',
'dialog',
'div',
'dl',
'dt',
'em',
'embed',
'fieldset',
'figcaption',
'figure',
'footer',
'form',
'h1',
'h2',
'h3',
'h4',
'h5',
'h6',
'header',
'hgroup',
'hr',
'i',
'iframe',
'img',
'input',
'ins',
'kbd',
'label',
'legend',
'li',
'main',
'map',
'mark',
'menu',
'meter',
'nav',
'object',
'ol',
'optgroup',
'option',
'output',
'p',
'picture',
'pre',
'progress',
'q',
'rp',
'rt',
'ruby',
's',
'samp',
'section',
'select',
'small',
'source',
'span',
'strong',
'sub',
'summary',
'sup',
'svg',
'table',
'tbody',
'td',
'template',
'textarea',
'tfoot',
'th',
'thead',
'time',
'tr',
'track',
'u',
'ul',
'var',
'video',
'wbr',
];
export const htmlAttributes = [
'abbr',
'accept',
'accept-charset',
'accesskey',
'action',
'align',
'alt',
'async',
'autocomplete',
'autofocus',
'autoplay',
'bgcolor',
'border',
'buffered',
'challenge',
'charset',
'checked',
'cite',
'class',
'code',
'codebase',
'color',
'cols',
'colspan',
'content',
'contenteditable',
'contextmenu',
'controls',
'coords',
'crossorigin',
'data',
'datetime',
'default',
'defer',
'dir',
'dirname',
'disabled',
'download',
'draggable',
'dropzone',
'enctype',
'for',
// 'form', // also an element, so don't support as attribute
'formaction',
'headers',
'height',
'hidden',
'high',
'href',
'hreflang',
'http-equiv',
'icon',
'id',
'integrity',
'ismap',
'itemprop',
'keytype',
'kind',
// 'label', // also an element, so don't support as attribute, but it's non-standard anyways
'lang',
'language',
'list',
'loop',
'low',
'manifest',
'max',
'maxlength',
'media',
'method',
'min',
'multiple',
'muted',
'name',
'novalidate',
'open',
'optimum',
'pattern',
'ping',
'placeholder',
'poster',
'preload',
'radiogroup',
'readonly',
'rel',
'required',
'reversed',
'rows',
'rowspan',
'sandbox',
'scope',
'scoped',
'selected',
'shape',
'size',
'sizes',
'span',
'spellcheck',
'src',
'srcdoc',
'srclang',
'srcset',
'start',
'step',
'style',
'summary',
'tabindex',
'target',
'title',
'translate',
'type',
'usemap',
'value',
'width',
'wrap',
];
export const svgElements = [
'a',
'altGlyph',
'altGlyphDef',
'altGlyphItem',
'animate',
'animateColor',
'animateMotion',
'animateTransform',
'circle',
'clipPath',
// 'color-profile', // also an attribute, so not allowing as an element, but may add detection and support both in the future
// 'cursor', // also an attribute, so not allowing as an element, but may add detection and support both in the future
'defs',
'desc',
'discard',
'ellipse',
'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',
// 'filter', // also an attribute, so not allowing as an element, but may add detection and support both in the future
// 'font', // also an attribute, so not allowing as an element, but may add detection and support both in the future
'font-face',
'font-face-format',
'font-face-name',
'font-face-src',
'font-face-uri',
'foreignObject',
'g',
'glyph',
'glyphRef',
'hatch',
'hatchpath',
'hkern',
'image',
'line',
'linearGradient',
// 'marker', // also an attribute, so not allowing as an element, but may add detection and support both in the future
'mask',
'mesh',
'meshgradient',
'meshpatch',
'meshrow',
'metadata',
'missing-glyph',
'mpath',
'path',
'pattern',
'polygon',
'polyline',
'radialGradient',
'rect',
// 'script', // also an attribute, so not allowing as an element, plus dangerous
'set',
'solidcolor',
'stop',
// 'style', // disallow css definitions
'svg',
'switch',
'symbol',
'text',
'textPath',
// 'title', // we're not supporting full documents
'tspan',
'unknown',
'use',
'view',
'vkern'
];
export const svgAttributes = [
'accent-height',
'accumulate',
'additive',
'alignment-baseline',
'alphabetic',
'amplitude',
'arabic-form',
'ascent',
'attributeName',
'attributeType',
'azimuth',
'baseFrequency',
'baseline-shift',
'baseProfile',
'bbox',
'begin',
'bias',
'by',
'calcMode',
'cap-height',
'class',
'clip',
'clipPathUnits',
'clip-path',
'clip-rule',
'color',
'color-interpolation',
'color-interpolation-filters',
'color-profile',
'color-rendering',
'contentScriptType',
'contentStyleType',
'cursor',
'cx',
'cy',
'd',
'decelerate',
'descent',
'diffuseConstant',
'direction',
'display',
'divisor',
'dominant-baseline',
'dur',
'dx',
'dy',
'edgeMode',
'elevation',
'enable-background',
'end',
'exponent',
'externalResourcesRequired',
'fill',
'fill-opacity',
'fill-rule',
'filter',
'filterRes',
'filterUnits',
'flood-color',
'flood-opacity',
'font-family',
'font-size',
'font-size-adjust',
'font-stretch',
'font-style',
'font-variant',
'font-weight',
'format',
'from',
'fr',
'fx',
'fy',
'g1',
'g2',
'glyph-name',
'glyph-orientation-horizontal',
'glyph-orientation-vertical',
'glyphRef',
'gradientTransform',
'gradientUnits',
'hanging',
'height',
'href',
'hreflang',
'horiz-adv-x',
'horiz-origin-x',
'id',
'ideographic',
'image-rendering',
'in',
'in2',
'intercept',
'k',
'k1',
'k2',
'k3',
'k4',
'kernelMatrix',
'kernelUnitLength',
'kerning',
'keyPoints',
'keySplines',
'keyTimes',
'lang',
'lengthAdjust',
'letter-spacing',
'lighting-color',
'limitingConeAngle',
'local',
'marker-end',
'marker-mid',
'marker-start',
'markerHeight',
'markerUnits',
'markerWidth',
'mask',
'maskContentUnits',
'maskUnits',
'mathematical',
'max',
'media',
'method',
'min',
'mode',
'name',
'numOctaves',
'offset',
'opacity',
'operator',
'order',
'orient',
'orientation',
'origin',
'overflow',
'overline-position',
'overline-thickness',
'panose-1',
'paint-order',
'path',
'pathLength',
'patternContentUnits',
'patternTransform',
'patternUnits',
'pointer-events',
'points',
'pointsAtX',
'pointsAtY',
'pointsAtZ',
'preserveAlpha',
'preserveAspectRatio',
'primitiveUnits',
'r',
'radius',
'refX',
'refY',
'rendering-intent',
'repeatCount',
'repeatDur',
'requiredExtensions',
'requiredFeatures',
'restart',
'result',
'rotate',
'rx',
'ry',
'scale',
'seed',
'shape-rendering',
'slope',
'spacing',
'specularConstant',
'specularExponent',
'speed',
'spreadMethod',
'startOffset',
'stdDeviation',
'stemh',
'stemv',
'stitchTiles',
'stop-color',
'stop-opacity',
'strikethrough-position',
'strikethrough-thickness',
'string',
'stroke',
'stroke-dasharray',
'stroke-dashoffset',
'stroke-linecap',
'stroke-linejoin',
'stroke-miterlimit',
'stroke-opacity',
'stroke-width',
'style',
'surfaceScale',
'systemLanguage',
'tabindex',
'tableValues',
'target',
'targetX',
'targetY',
'text-anchor',
'text-decoration',
'text-rendering',
'textLength',
'to',
'transform',
'type',
'u1',
'u2',
'underline-position',
'underline-thickness',
'unicode',
'unicode-bidi',
'unicode-range',
'units-per-em',
'v-alphabetic',
'v-hanging',
'v-ideographic',
'v-mathematical',
'values',
'vector-effect',
'version',
'vert-adv-y',
'vert-origin-x',
'vert-origin-y',
'viewBox',
'viewTarget',
'visibility',
'width',
'widths',
'word-spacing',
'writing-mode',
'x',
'x-height',
'x1',
'x2',
'xChannelSelector',
'xlink:actuate',
'xlink:arcrole',
'xlink:href',
'xlink:role',
'xlink:show',
'xlink:title',
'xlink:type',
'xml:base',
'xml:lang',
'xml:space',
'y',
'y1',
'y2',
'yChannelSelector',
'z',
'zoomAndPan'
];
export const elementDefaultAttributes: Record> = {
a: {
target: '_blank',
},
svg: {
xmlns: 'http://www.w3.org/2000/svg',
}
};