This is mainly a note to myself so I don't forget to apply a pretty simple fix:
tree-sitter-markdown is actually two parsers in one — one handles block-level elements and the other is injected into inline nodes to handle inline elements. But the block-level parser arguably has a bug: it doesn't always add inline nodes where it should.
For instance, a table creates lots of pipe_table_cell nodes, and each of them should probably have an inline node child to mark where the inline parser should take over. But those don't exist. Thus any valid inline Markdown inside a table cell (emphasis, inline code, hyperlinks) is not properly syntax-highlighted.
Anyway, this is pretty easily worked around:
atom.grammars.addInjectionPoint('source.gfm', {
type: 'pipe_table_cell',
language: () => {
return 'markdown-inline-internal';
},
content: (node) => node,
includeChildren: true,
languageScope: null
});
A user could even add this to their init.js as a workaround! But I should just add it to the existing injection points created by language-gfm.
This is mainly a note to myself so I don't forget to apply a pretty simple fix:
tree-sitter-markdownis actually two parsers in one — one handles block-level elements and the other is injected intoinlinenodes to handle inline elements. But the block-level parser arguably has a bug: it doesn't always addinlinenodes where it should.For instance, a table creates lots of
pipe_table_cellnodes, and each of them should probably have aninlinenode child to mark where the inline parser should take over. But those don't exist. Thus any valid inline Markdown inside a table cell (emphasis, inline code, hyperlinks) is not properly syntax-highlighted.Anyway, this is pretty easily worked around:
A user could even add this to their
init.jsas a workaround! But I should just add it to the existing injection points created bylanguage-gfm.