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

Use the <ins> and <del> elements in Codeblocks #358

Closed
ryceg opened this issue Oct 13, 2022 · 2 comments
Closed

Use the <ins> and <del> elements in Codeblocks #358

ryceg opened this issue Oct 13, 2022 · 2 comments
Labels
documentation Improvements or additions to documentation

Comments

@ryceg
Copy link
Contributor

ryceg commented Oct 13, 2022

Link to the Page

https://skeleton.brainandbonesllc.com/guides/tailwind

Describe the Issue

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/ins is a native html element that provides more semantic information.

This would involve a little bit of preprocessing before highlight.js takes over.

Are you able to create a Pull Request with the fix?

Yes

@ryceg ryceg added the documentation Improvements or additions to documentation label Oct 13, 2022
@endigo9740
Copy link
Contributor

endigo9740 commented Oct 14, 2022

@ryceg this is a neat idea, but not something I think may be possible when Highlight.js is enabled. Take a look at the markup for a code block processed by Highlight:

Screen Shot 2022-10-14 at 11 26 23 AM

The del and ins tags are no longer whole tags. They're split up into spans and smaller chunks so CSS styles can be applied selectively. I'm not aware of any syntax highlighter where you could make exceptions for certain tags either.

However, I do see the value of these tags. Perhaps examples can be setup outside of code blocks, since nothing on MDN seems to indicate these must strictly be used within pre or code elements. I've gone ahead and pushed a small update to the dev branch including the following addition to the typography.css stylesheet and docs:

Screen Shot 2022-10-14 at 11 51 48 AM

If you think this will suffice then feel free to close out the ticket please!

@ryceg
Copy link
Contributor Author

ryceg commented Oct 14, 2022

Yeah, I'm a little surprised that highlight js doesn't have some form of support for this sort of use pattern. Short of passing in each insert and delete individually, I think that it's likely too much work to figure out a cleaner way of getting it to work.

Adding some styling for those that want to use the element is a decent fix.

@ryceg ryceg closed this as not planned Won't fix, can't repro, duplicate, stale Oct 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants