Closed anuramat closed 5 months ago
Feature 1 should be quite doable, it would just imply improving the rules for parsing the language here:
I personally will probably have no capacity to work on this though.
Feature 2 would be quite hard, since it both is hard to detect (one would need to know if there is an end block before it is clear whether something is latex) and collides with other grammar rules.
Feature 1 already works, though, by virtue of injections? You just have to use proper language annotations:
```latex
\begin{tabular}{|l|l|}\hline
Age & Frequency \\ \hline
18--25 & 15 \\
26--35 & 33 \\
36--45 & 22 \\ \hline
\end{tabular}
your example would be pasted as a (visible) code block, and the one with {=latex}
would be inserted in the actual latex output as latex code, or rendered, in case the output format is e.g. pdf, in this case as a table
That's completely out of scope for a Markdown tree-sitter parser, sorry. I would recommend creating your own pandoc
parser that extends this one (grammars can inherit others).
(We've had other issues with forcing pandoc files as markdown, so I'd prefer to treat this as a separate filetype from here on out.)
Did you check the tree-sitter docs?
Is your feature request related to a problem? Please describe.
Pandoc has a few handy extensions, that allow embedding raw content in the output document. It would be nice to support these for e.g. highlighting.
Raw attributes
Raw TeX
Describe the solution you'd like
\begin{}
-\end{}
blocks); I'm not sure if supporting other *TeX commands would be feasible.Describe alternatives you've considered
No response
Additional context
https://pandoc.org/MANUAL.html#extension-raw_attribute https://pandoc.org/MANUAL.html#extension-raw_tex