-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
support adding attributes to code blocks #826
Comments
The issue is not due to |
What is expected to happen here? I mean where should Is this common feature that markdown attrs plugin supports? |
Oh thanks! OK... well yeah seems like we should be supporting this then 😅 How do we combine this with Line Highlighting? Should below work...?
|
Don't think they both will play nice with each other. Here is a workaround for that: arve0/markdown-it-attrs#63 (comment) -- or we can probably modify our highlightLinePlugin to use different limiters. |
Nice we have workaround. Yeah and I agree if we were to change anything, we should change highlightLinePlugin syntax. It's a small breaking change but, this is the time to introduce that change. |
I'd like to work on this change if you agree to the current workaround solution. |
Yeah, I think we could try! So the ideal syntax would be...
or
But I guess we need to do some try and errors and see if this API fits well without any confusing edge cases. |
@kiaking ```ts {data=[0]}
``` |
Well I don't think so...? Is there any use case for it? |
Oh, sorry, I'm not so familiar with Not a real case for now, but it could happen in theory. |
attrs
is not working on code
block due to highlightLinePlugin
Describe the bug
vitepress/src/node/markdown/plugins/highlightLines.ts
Line 30 in 75ca9e4
highlightLinePlugin
is used beforeattrs
, andtoken.info
is rewritten.via #664 (comment)
Reproduction
Expected behavior
Render
data="asdf"
System Info
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: