-
-
Notifications
You must be signed in to change notification settings - Fork 411
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
Extra Line Rendered with Line-Based Magic Comments in Code Highlighting #915
Comments
I agree. I find it distracting that a transformer-highlight comment (when placed on its own line) leaves a blank line in the output. |
@antfu Thanks a lot for the fix, much appreciated! |
Doesn't seem like this issue is fixed (at least, not for |
@sheremet-va You might want to upgrade vitepress to v2.0.0-alpha.x and add versions resolutions |
Does it mean this fix doesn't work in vitespress@stable? |
Validations
Describe the bug
When using magic comments for code highlighting, I noticed an extra line rendered when the comment is on its line, compared to when it is inline. This only happens on the first line.
Example 1: Inline Comment (No Extra Line)
This renders correctly without any extra lines.
Example 2: Line-Based Comment (Extra Line Rendered)
In this case, an extra line is rendered above the highlighted block.
Screenshot
transformerNotationHighlight
transformerNotationWordHighlight
transformerNotationFocus
Expected Behavior
Both inline and line-based magic comments should render the code block without introducing extra lines.
Actual Behavior
Line-based magic comments introduce an extra line above the highlighted block.
Additional Notes
I am unsure if this is expected behavior or a bug and if there is an existing issue that points to this behavior.
Reproduction
https://shiki.style/packages/transformers#transformernotationhighlight
Contributes
The text was updated successfully, but these errors were encountered: