The discussion revolves around text highlighting in Discourse using CommonMark Markdown. Lew_Grothe notes that while strikethrough (~~strikethrough~~) works, highlighting with ==highlight== does not, despite being supported in the CommonMark spec and by Ghost. Falco clarifies that Discourse uses Markdown-it, which supports highlighting via the <mark> tag, but this feature isn’t enabled by default. Lew_Grothe inquires about potential limitations in the Markdown-it version used. Falco confirms that Markdown-it is used as-is, and plugins like footnotes are available. cpradio suggests re-packaging the markdown-it-mark plugin as a Discourse plugin. sirideain creates such a plugin, which is then shared. sam invites a full plugin post. codinghorror notes existing ins and del tags. Andrei_Blanda seeks help with installation, and david clarifies it’s a plugin, not a theme, and provides installation instructions.
Probably not really a bug but, I know that “standard” Markdown discussions are somewhat fraught and this question seems to not be dealt with in the latest ComonMark spec but…
It appears that, in accordance with at least one (the Ghost project) guide of the CommonMark spec:
~~strikethrough~~
should give you a strikethrough (and it does) but
==highlight==
should give you a ==highlight== text - and it doesn’t.
Attempting to use <span style=“background-color:yellow;”> tags or other means seems to also not work for me…
So, based on the CommonMark used by Discourse, is there a way to do text highlighting? Is there a better guide for us to use to get answers to questions like this?
Someone would have to re-package the highlight markdown-it plugin into a Discourse plugin for it to become available. You could likely take a stab at it by forking the footnote plugin and finding all instance of footnote and replacing it with “mark”
This caught my interest as I thought it would useful on my installation as well. So here is a plugin for highlighting. Being as it is my first plugin, I suspect it needs a fair bit of cleanup even with having used other plugins as templates/inspiration. It did work in my test environment though.