Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature - Support {.language .other-class } ... language tag syntax in Markdown #296

Closed
volodymyrprokopyuk opened this issue Jun 21, 2021 · 2 comments

Comments

@volodymyrprokopyuk
Copy link

Hello,

Currently polymode supports only the ```language ... ``` language tag syntax to switch to the appropriate major mode for the language.

Pandoc markdown supports addition of HTML classes to a code block with the following syntax ```{.language .numbered} ... ```, which causes polymode to fall back to markdown major mode instead of switching to the appropriate language major mode.

Could you, please, extend polymode to support the Pandod markdown language class syntax?

Thank you!

@volodymyrprokopyuk volodymyrprokopyuk changed the title Feature - Support {.language .other-class } ... language tag syntax in Markdown Feature - Support {.language .other-class } ... language tag syntax in Markdown Jun 21, 2021
@volodymyrprokopyuk volodymyrprokopyuk changed the title Feature - Support {.language .other-class } ... language tag syntax in Markdown Feature - Support {.language .other-class } ... language tag syntax in Markdown Jun 21, 2021
@vspinu
Copy link
Collaborator

vspinu commented Jun 25, 2021

The {mode xyz} syntax is already supported. The issue was . in front of the class.

@volodymyrprokopyuk
Copy link
Author

Hi,

The . dot is actually the point of the issue (name the language of a chunck with a .language class), not a typo.

When using ```{latext .numberLInes} ... ``` which is supported by polymode with correct latex highlighting in emacs, knitr reports the error of Unknown language engine `latex` .

When using the new requested language class syntax to be supported by polymode ```{.latext .numberLInes} ... ```, knitr forwards correctly the results to pandoc which correctly does syntax highlighting of the latex code. The only issue with this new syntax is that in emacs the code chunk is not highlighted as latex, because the language class syntax is not currently supported by polymode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants