zed
zed copied to clipboard
Support rendering strikethrough text in markdown
Just noticed strikethrough text handling was not implemented for the following:
Chat
Markdown Preview
Code Documentation
It looks like there are three different markdown parsing/rendering implementations, might be worth to investigate if any of these can be combined into a single crate (looks like a lot of work though).
Release Notes:
- Added support for rendering strikethrough text in markdown elements
@SomeoneToIgnore looks like pulldown_cmark
handles the parsing differently then GitHub.
Take a look at this example:
Nested Italic
Text:
**as*teri*sks**
Parser output:
Start(Paragraph)
Start(Strong)
Text(Borrowed("as"))
Start(Emphasis)
Text(Borrowed("teri"))
End(Emphasis)
Text(Borrowed("sks"))
End(Strong)
End(Paragraph)
Nested Strikethrough
Text:
**as~~teri~~sks**
Parser output:
Start(Paragraph)
Start(Strong)
Text(Borrowed("as~~teri~~sks"))
End(Strong)
End(Paragraph)
As you can see the parser picks up the nested italic, but not the nested strikethrough. I'll take some more time to look into this.
Looks like it was fixed in the 0.10.x version of pulldown-mark. I'll try to upgrade the dependency
Here is what it looks like now:
I cannot spot a difference to the GitHub one, other than the line breaks at the last few lines (which is not a regression).
I'll make sure to add a test to markdown parser for the nested case.