-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Strikethrough does not work with a space just inside of it #520
Comments
@thesunny this is to spec. You example This is ~~text that has strikethrough ~~ in it and does not work (space at end)
This is ~~ text that has strikethrough~~ in it and this also does not work (space at front) renders as This is which matches has remark parses it https://astexplorer.net/#/gist/9e65a4608b9e79c42eddbc5785d5c428/056450d5fa2badbd5f6051f266925a2b6c8975ef You can find the spec here: |
Hmm... I'm looking at the source code and I see that this behavior seems intentional. I also notice that GFM parses this the same way which is IMO broken. It also parses bold and italic this way which remark does not. According to the GFM docs here: https://github.github.com/gfm/#strikethrough-extension- It doesn't mention any special behavior with respect to spaces just inside the tokens for strikethrough and seems to suggest that strikethrough should be parsed the same as emphasis. From their docs:
In other words, it seems strikethrough should work the same as bold and italic. I don't want to make things worse for myself, but bold and italic are broken in GFM. For example, if I type in this code in GitHub (ie. right here). **bold **_italic _~~strikethrough ~~ **bold **_italic _~~strikethrough ~~ None of these work. But bold and italic work in remark but strikethrough does not. My suggestion is we fix |
Thanks for the update @ChristianMurphy and thanks for the quick response. |
Subject of the issue
Strikethrough works in this scenario:
But is parsed as plain text with the literal
~~
when there is a space in itThese two lines also render fine in GitHub:
Notably, bold and italic work find with spaces just inside the tokens.
Your environment
Steps to reproduce
Here is a minimal reproduction on GitHub.
Just clone,
yarn
andyarn start
Expected behaviour
It should parse a strikethrough with a space in it as the formatting of a strikethrough
Actual behaviour
It parses it as literal text
The text was updated successfully, but these errors were encountered: