MarkdownParser strikethrough

Hi, I’m currently trying to parse strikethrough (i.e. ~~), a format built into markdown-it. I looked through the tokens generated by markdown-it for a strikethrough-formatted text (i.e. test), but it only came back with one ‘text’ token rather than an expected ‘s_open’ and ‘s_close’ like for emphasis formatting. (i.e. em => em_open, em_close), so I couldn’t figure out what to add to the ‘tokens’ object in MarkdownParser. Currently it’s just s: {mark: "strikethrough"} where strikethrough is the mark in the schema, but that doesn’t work. Am I missing something here, or should I try to just write a plugin for markdown-it for this? Thank you.

If markdown-it can render strikethrough, it’ll have to show up somehow in its token output. I haven’t worked with it before, but I would also expect it to use tokens like emphasis and strong do. So double-check the tokens, I guess, or maybe look at the markdown-it sources.

1 Like