[language-gfm] Make each block-level HTML tag its own injection…

…which, surprising as it sounds, has a _huge_ performance benefit.
This commit is contained in:
Andrew Dupont 2024-04-21 20:44:20 -07:00
parent 6d36685df3
commit 3d70f62953

View File

@ -23,13 +23,11 @@ exports.activate = () => {
languageScope: null languageScope: null
}); });
// Create one HTML injection layer for all block-level HTML nodes. // A separate injection layer for each block-level HTML node.
atom.grammars.addInjectionPoint('source.gfm', { atom.grammars.addInjectionPoint('source.gfm', {
type: 'document', type: 'html_block',
language: () => 'html', language: () => 'html',
content(node) { content: (node) => node,
return node.descendantsOfType('html_block');
},
includeChildren: true includeChildren: true
}); });