change <del> element CSS styling to use line-through #1181
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this PR change? What problem does it solve?
I used the markdown
~~strikethrough~~
markup in a blog post, and noticed that it was rendering weirdly in Firefox 111:In Chrome it rendered correctly:
It turns out, that hugo converts
~~
to the HTMLdel
element. This element was apparently not supported in Chrome until recently, which is why I guess this fix was introduced in hugo-Paper back in the day. hugo-Paper removed the original linear-gradient solution in v6 released in July 2023.According to caniuse.com only around 69% of mobile user and 22% desktop users use a browser that supports this element.
I assume that this will change rapidly with the Chrome support (Version 111, released March 7th 2023).
But I would still propose that we style this element manually, as it can be quite important to indicate that a phrase is no longer up to date/valid.
Therefore this change uses
text-decoration: line-through
to archive the same effect across browsers.After fix in Firefox 111:
After fix in Chrome 111:
Was the change discussed in an issue or in the Discussions before?
I couldn't find anything.
PR Checklist