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

change <del> element CSS styling to use line-through #1181

Conversation

dubbl
Copy link
Contributor

@dubbl dubbl commented Mar 28, 2023

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:

Image showing a very thin and broken line through text

In Chrome it rendered correctly:

Image showing normal strike-through text

It turns out, that hugo converts ~~ to the HTML del 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:
Correctly strike through text

After fix in Chrome 111:
Correctly strike through text

Was the change discussed in an issue or in the Discussions before?

I couldn't find anything.

PR Checklist

  • This change adds/updates translations and I have used the template present here.
  • I have enabled maintainer edits for this PR.
  • I have verified that the code works as described/as intended.
  • This change adds a Social Icon which has a permissive license to use it.
  • This change does not include any CDN resources/links.
  • This change does not include any unrelated scripts such as bash and python scripts.
  • This change updates the overridden internal templates from HUGO's repository.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@adityatelange adityatelange merged commit 2210bf2 into adityatelange:master Mar 31, 2023
@adityatelange
Copy link
Owner

Thanks @dubbl

jdxgfty pushed a commit to jdxgfty/hugo-PaperMod that referenced this pull request Nov 3, 2024
According to caniuse.com only around 69% of mobile user and 22% desktop users use a browser that supports this element. Therefore this change uses text-decoration: line-through to archive the same effect across browsers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants