Discourse Mark Plugin


#1

discourse-mark

Repository: GitHub - sirideain/discourse-mark: Bundles https://github.com/markdown-it/markdown-it-mark as a Discourse plugin

Features

  • Adds an editor option to highlight text.

Usage

You can wrap text with == to highlight it.

==Highlighted Text==

Installation

Known Issues

  • None

Future

  • Update icon to highlighter once Font Awesome 5 is available

Adding schemes to markdown linkify
(Jeff Atwood) #2

This is already sort of possible in default Discourse with HTML tags

inserted text and deleted text

<ins>inserted text</ins> and <del>deleted text</del>

Not quite the same as “highlighted” but a very similar effect at least for <ins>


(Stephen) #3

I think @sirideain put this together following this thread: Discourse CommonMark text highlighting?


(Jeff Atwood) #4

Yes totally fine, just pointing out there’s an alternative “sort-of” way to do this built in. I don’t think Commonmark even specifies highlight as part of the standard…


(Stephen) #5

I think they’re fundamentally different things though? Insertions and deletions may be used in parallel with highlighting.


(Jeff Atwood) #6

That’s a very literal reading. If I was to tell you I just highlighted this text how would anyone reading even know any different? Particularly if I changed the CSS to whatever color and style I liked…


(Stephen) #7

Highlighting indicates areas for attention, insertions and deletions indicate change.

Sure, we can use CSS to restyle elements, we could also for example set background-color on anything within <strong> tags, but then we would lose the ability to make things bold without also highlighting them. The plugin lets us highlight passages without losing differentiation between the styles associated with tracked changes. Being a totally optional plugin which expands upon a well-established convention I don’t see tremendous value in confusing the two.


(Jeff Atwood) #8

It is not part of the commonmark spec, that is for sure.


(Justin DiRose) #9

It would be great if this followed other common Markdown highlight syntax. I’m not sure if it’s in a particular spec (a quick Google search didn’t yield anything), but popular Markdown apps with the highlight feature use double colons to enclose text, like so:

::Highlighted Text::

Love the idea though!


#10

Discourse is using markdown-it for parsing markdown. I am bundling the markdown-it-mark plugin so it is available in Discourse. Support for this syntax would need to be added there.


(Peter N Lewis) #11

I installed this, and the ==text== highlighting works, but the Highlight Text option does not show up in the gear menu.

Curiously the Green Tick does not show next to the plugin either:

but I don’t know if that is related.


(Jeff Wong) #12

The green tick will only appear next to official plugins that are supported by the core discourse team, to distinguish them from 3rd party plugins.


Ref: Official Plugins
#13

There was an issue where the highlighting was not respecting the enable setting, but the gear menu option was. This has been fixed now.