-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Highlight Inline Code Blocks #599
Comments
This plugin currently does not target inline code at all. To clarify: Would you like to have just the |
Oops, thanks for pointing that out.
Best case all functionality. That would be great. |
Alright. So let’s teach this plugin to optionally also target inline code ✔️. |
@andreas-mausch highlighting inline code is implemented in #616. Can you please give feedback on it? In particular, what’s your take on the syntax `class Demo { };`{language=cpp} to specify the language for inline code? I’d like to make sure the syntax makes sense & is usable before merging, as changing it afterwards would be a breaking change. |
Hi, your change works great! The default language was successfully set on the code tag. 👍
I think it looks great. Easy to understand. For my personal requirements the default language should be good enough though. // Works:
`class Demo { };`{language=cpp}
// = <code class="language-cpp">
// Also works:
`class Demo { };`{data-myattr=value}
// = <code data-myattr="value" class="language-plain">
// This is not rendered as expected:
`class Demo { };`{language=cpp, data-myattr=value}
// Rendered: <code data-myattr="value" class="language-plain">
// Expected: <code data-myattr="value" class="language-cpp"> I wonder if the last case is really needed. I do not need it.
but for inline code I don't need it. Thank you very much for your effort. |
Thank you very much for your detailed feedback!
Yep, that was an oversight. I fixed it & added a test case.
Great, so I’ll merge it that way.
I think it is, see below.
This renders exactly like I intended it to. My intention was to not introduce additional syntax to markdown-it, but rather freeload on the existing markdown-it-attrs syntax. This effectively makes Alternatively, I could have mandated the syntax
However, I find this awkward. First, it is less intuitive, and second, if the lang-prefix setting in markdownIt was changed, one would have to update all the language specifications.
I don’t. But if you had the chance to give a little to UNHCR instead, that’d be a great reward for me! |
# [2.3.0](v2.2.5...v2.3.0) (2022-08-30) ### Features * highlight inline code [#599](#599) ([e7c91ac](e7c91ac))
🎉 This issue has been resolved in version 2.3.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Hi, the default language works well for normal code blocks (triple ```).
However, for
the code is rendered as
instead of
The text was updated successfully, but these errors were encountered: