-10

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:

Strike-through

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

(Source)

How is this useful to Stack Overflow users

  • To show comparison:

You're using the wrong command change npm run dev to 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:

  1. ~~text~~
  2. {--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.

10
  • 7
    You haven't said why we'd want it. What is the use case? Commented Sep 1 at 20:21
  • 7
    I don't see how this is useful. Struck-through text is generally something that can be removed completely with no loss of value.
    – Cerbrus
    Commented Sep 1 at 20:25
  • 3
    I've added a section on why we would want it. In general through I think it is best too leave it to the poster and the use case. Additionally this isn't really any harm in adding it. It won't take up an extra button. It will only add value.
    – Ethan
    Commented Sep 1 at 21:20
  • 3
    Do we want curators to use strikethroughs for updating content? Posts that are out-of-date should be improved but the exact wording that existed before does not need to be preserved (it is automatically preserved in revision history).
    – kmdreko
    Commented Sep 1 at 21:27
  • A) <strike></strike> is deprecated/obsolete in HTML. Instead, use <del></del> for deleted content, or <s></s> in all other cases. B) Please explain what you mean by using HTML for <strike></strike> is "not universally reliable". Do you mean browsers don't support it. If so, see (A) above.
    – Makyen Mod
    Commented Sep 1 at 21:27
  • C) Using <strike></strike> is documented (but should be changed to <s></s>). See the in-page help that's available by clicking the "?" at the top of the editor and click on "HTML". Admittedly, it's not also on the page you've linked. However, that page does link to "What HTML tags are allowed on Stack Exchange sites?", which is a comprehensive list. It's not reasonable to have that help page have a comprehensive list of all supported HTML along with explanations for each. You need to make a case for why <s></s> should be on that page.
    – Makyen Mod
    Commented Sep 1 at 21:27
  • @Makyen A) I wasn't aware of that I well edit the post to use <s> B) It is not universally available as in not available in the comment/staging ground editor C) Once again I missed that. However, I still think strikethrough as a basic piece of formatting a poster may take for granted in a rich text editor like TinyMCE. Therefore an effort should be made to highlight how a user can use it.
    – Ethan
    Commented Sep 1 at 21:37
  • I mean, I can't see a reason not to do this. But it's definitely a low priority change. There are so many feature requests right now that this one will probably be on the back burner for a while.
    – Anerdw
    Commented Sep 1 at 22:11
  • @Anerdw There are other reasons too including accessibility. See the post edit
    – Ethan
    Commented Sep 1 at 22:30
  • 4
    @Ethan that edit shows that you do not understand the accessibility problems you think your FR "solves". Screen readers are equally bad at parsing <strike> or <del> or <s> tags. And in the end, you haven't shown what having this available would actually provide. Could you provide a use-case where this kind of markup would make sense, and not be simply a distraction/harmful?
    – yivi
    Commented Sep 2 at 6:42

2 Answers 2

15

You point out 2 use-cases, but I don't think either of them are better with a strike-through:

1. To show comparison:

You're using the wrong command. Change npm run dev to npm run start

The strike-through just makes the line less readable, compared to plain text:

You're using the wrong command. Change npm run dev to npm run start

2. 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)

Just... Remove it:

in version 1.2 you can use universal-fs without a password

(Also, the semantically correct element to use for documented edits would be <del>)


Neither case benefits from a strike-through.

7
  • 1
    I'd suggest using <s></s> instead of <strike></strike>, as <strike></strike> is deprecated/obsolete.
    – Makyen Mod
    Commented Sep 1 at 21:31
  • 8
    Adding to the second part about outdated information and why it should be removed: Many screen readers will happily read out your outdated text because they won't parse strike through (no matter which tag you use for it) without any distinction audible to the user. I don't think this should be encouraged by making it easier to use.
    – LW001
    Commented Sep 1 at 21:40
  • 1
    @LW001 This is yet another reason why this feature is beneficial. When trying to achieve strikethrough someone may use deprecated strike instead of s or del.
    – Ethan
    Commented Sep 1 at 23:55
  • @Ethan Adding this to markdown wouldn't mean removing support for <strike>.
    – Cerbrus
    Commented Sep 2 at 6:30
  • @Makyen this answer basically states that no form of strikethrough is useful to SO, so I don't see the need to mention using <s>, instead :-)
    – Cerbrus
    Commented Sep 2 at 6:42
  • @Cerbrus I didn't say mention it. I suggested that you use <s></s> instead of <strike></strike>, as in edit the post to use <s></s> instead of <strike></strike>.
    – Makyen Mod
    Commented Sep 2 at 7:34
  • 1
    Ah, I misunderstood @Makyen. Seeing as that text is quoted from the OP, I'd prefer to keep it identical to the OP.
    – Cerbrus
    Commented Sep 2 at 7:38
3

I stand corrected here, this feature is not a good idea.

  • As pointed out by @Cebrus using strikethrough does not add any value to posts
  • Additionally using strikethrough is bad for accessibility all together as shown by @yivi

However, the ability to use deprecated tags in the markdown editor does bring up a point on reliability across the site but that is a different topic.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .