htmlLanguage top-level constant
Grammar
const htmlLanguage
HTML, with embedded CSS in <style> and JavaScript in <script>.
Implementation
const htmlLanguage = Grammar(
name: 'html',
// Vue and Svelte single-file components are HTML with embedded script and
// style elements.
aliases: ['htm', 'xhtml', 'vue', 'svelte'],
fileExtensions: ['html', 'htm', 'xhtml', 'vue', 'svelte'],
caseInsensitive: true,
signatures: [
r'<!doctype\s+html',
r'<(?:html|head|body|div|span|script|p|a|meta|link)\b[^>]*>',
r'</(?:div|span|p|a|body|html)>',
],
rules: markupRules,
repository: {
...markupRepository,
'tag': [_script, _style, markupTag],
},
);