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

Inline language breaks with markdown-it-attrs #24

Closed
Maxim-Mazurok opened this issue Apr 5, 2022 · 1 comment
Closed

Inline language breaks with markdown-it-attrs #24

Maxim-Mazurok opened this issue Apr 5, 2022 · 1 comment

Comments

@Maxim-Mazurok
Copy link

I am using https://www.npmjs.com/package/markdown-it-attrs and it broke the inline language feature:

`alert("Dog")`{:.js}

I tried to put highlights before attrs - didn't help.

This helped:

.use(markdownItAttrs, {
  leftDelimiter: '{attrs=',
  rightDelimiter: '=attrs}',
})
@valeriangalliat
Copy link
Owner

Interesting, yeah it looks like markdown-it-attrs syntax somewhat conflicts with Pandoc and kramdown syntax for inline code language.

I refactored a bunch of things in v4.0.0 and I made sure to parse the inline code language at an earlier parsing step (originally I was doing it at the render step), so that we can get a chance to parse it before markdown-it-attrs.

So in v4.0.0 you can include markdown-it-highlightjs before markdown-it-attrs and it'll work just as you expected!

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