-
-
Notifications
You must be signed in to change notification settings - Fork 632
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
feat(code block): add line number attribute to code block lines #1973
Conversation
Β Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
β Deploy Preview for nuxt-content ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
Maybe there's a better way to make those line numbers available, so we're also able to display them next to the code as requested in #1970 |
I think it would be better if we add line number as a data attribute instead of class
This way, users can display line number using with CSS styling. WDYT @nobkd ? |
LGTM, then someone should be able to style a line with |
@farnabaz I think this should be mentioned in the docs, but I don't quite know where to put it. Do you have any suggestion? EDIT: I just added it first. Feel free to edit or move the notice. |
β Live Preview ready!
|
β Live Preview ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks
π Linked issue
#1972
#1970
β Type of change
π Description
This PR adds an attribute
line
for each line of a code block. Inline codes are unaffected.A line attributes contains the line number for the current line.
Non-highlighted code blocks always just had one line.
Therefore, a new function was added to split the plain code to individual lines.
π Checklist