A standard feature in Markdown is the ability to strike-through text. However, when I strike through in the Stack Overflow with standard syntax, nothing happens:
- Actual:
~~An example of strike-through text~~
- Expected:
Image may be NSFW.
Clik here to view.
Why?
In order to reach the desired result, I have to use the HTML syntax:
<s>An example of strikethrough text</s>
Which is far more verbose and not universally reliable. Worse yet strike-through is undocumented despite other HTML features being documented, meaning a user unfamiliar with Markdown might think they are doing something wrong!
This is already a feature in the following parsers:
- GFM
- ExtraMark
- MultiMarkdown
- Pandoc
- Markua
- Remarkable
- Showdown
- Ghost
- GitHub
- GitLab
- Redcarpet
- Trello
- s9e\TextFormatter
How is this useful to Stack Overflow users
- To show comparison:
You're using the wrong command change
tonpm run dev
npm run start
- It removes something out of date or deprecated:
universal-fs
does not support usage without a password(in version 1.2 you can use universal-fs without a password)
Accessibility
As mentioned by LW003 usage of the strike
tag can cause site wide problems for accessibility. Adding an official way to do this with Markdown and removing the ability to use the strike
tag.
Which implementation should be used
CommonMark does not specify an implementation, which leaves it open to many options.
There are 2 ways most markdown flavours handle this:
~~text~~
{--text--}
I think the best option is 1 for the following reasons:
- It requires the least amount of syntax
- The character
~
carries the meaning NOT in formal logic and some programming languages - It is hard to confuse with other markdown symbols
Additionally, this new feature will require documentation. I propose we add this documentation under strike-through in markdown help. We can phrase along the lines of:
~~An example of strikethrough text~~
In conclusion
Adding strike-through will be another reason to not need HTML in posts and make an overall better experience.