Fast Highlight

Hey, where did this “Share” button on the Fast Edit popup come from? I can’t find a setting to enable it.

Is that Share button from a Plugin or TC?

That’s a great question! And we both suspect that if we can find that, then your dream will be much closer to coming true!

I think it must be Social Share . . . well, it doesn’t look like it from that topic. . .

There are site settings where you can configure it. It works only on desktop view public topics.

share quote visibility
share quote buttons

FWIW setting explorer explains the settings well:

GPT Bot Settings Explorer

Look up site setting context

Reading context for: share_quote_buttons

The share_quote_buttons setting in Discourse determines which items appear in the quote sharing widget, and in what order. The default options include “Twitter” and “Email”.

This setting is client-side and allows you to choose from a list of options including Twitter, Facebook, and Email. However, it does not allow any other choices apart from these.

The setting also includes a validation check. For example, if Facebook is included in the share_quote_buttons but the Facebook app ID is not set in the site settings, it will return an error.

This setting affects the visibility and options of the quote sharing widget in the user interface. For example, if the share_quote_buttons setting includes “Twitter” and “Email”, then when a user selects a text to quote, they will see options to share the quote on Twitter and via Email.

In the Discourse codebase, you can find this setting in the site_settings.yml file and its validations in the validations.rb file. The functionality of this setting is also tested in the topic-quote-button-test.js file.

Look up site setting context

Reading context for: share_quote_visibility

The share_quote_visibility setting in Discourse determines when to show quote sharing buttons. There are three possible choices for this setting:

  • “none”: The quote sharing buttons will never be shown.
  • “anonymous”: The quote sharing buttons will only be shown to anonymous users.
  • “all”: The quote sharing buttons will be shown to all users.

The default setting is “anonymous”. This means that by default, quote sharing buttons will only be visible to users who are not logged in.

This setting is used in the quoteSharingEnabled function in the quote-button.js file. This function checks several conditions to determine whether quote sharing should be enabled. These conditions include whether the site is in desktop view, whether there are any active sharing sources, whether the topic is visible, whether the topic’s category is read restricted, and what the share_quote_visibility setting is set to.

In the acceptance tests for the topic quote button, this setting is used to determine whether the quote sharing buttons should be shown or not. If the setting is “all”, the quote sharing buttons are shown. If the setting is “none”, the quote sharing buttons are not shown.


“Floating Highlight Button” - yes, Love that name!

1 Like

Could it be more feasible (or altogether crazy?) to allow all – or a specific group – of the built-in composer toolbar buttons to become Fast Edit “Floating Toolbar”? (i.e. Instead of adding more buttons to the Fast Edit, add the “Floating” option to something like MD Composer Extras or bbcode buttons.)

(The thin air up here in the high altitude of the Colorado Rocky Mountains sometimes makes me highly aspirational.)
Mountain Bike Bikes GIF by Electric Cyclery

2 posts were split to a new topic: Change “share quote visibility” default from ANONYMOUS to ALL

Hmm, why use [wrap] when there is <mark>highlighted text</mark> which works out of the box?

This is highlighted text within a sentence.


LOL. Why indeed?


To simplify separated styling? (Or not?)

So kind to come to my defense, but . . .

That would be true only if you’re using <mark> in other places and want it to be different. I doubt that’s the case.

What I’d recommend (and given that I didnt’ know <mark> existed, you might consider the source!), is to just use <mark>. You wouldn’t need any CSS that way.


My future plan for this is to provide color options (via a color picker).

So, for example, I can select some text and apply a light blue highlight, and then select some other text and apply a pink highlight, and so on.

One (sometimes fatal, I think) limitation in the current version is that the highlight is site-wide, so changing the color applies that color change to every highlight on the site.

I mean, I guess it’s useful that the admin can change the highlight color globally, but beyond that it could be more frustrating for end users to see their highlights change color.

@merefield’s approach might be better suited as a starting point.

1 Like

Yeah. That’s lots better than my idea too. :slight_smile:

A cool idea, though it may not apply to you, would be to have a user-custom-field with a color in it and use that. Then each use could have their own highlight color.

1 Like

Yep, for sure. So really 2 different Theme Components here (both integrating a color-picker).

  1. Site-global setting including a per-user global setting, starting with basis Highlighter Composer Button

  2. Composer/Fast Edit Button (with added CTRL-H keyboard shortcut) for select-color highlighting on-the-fly, based on @merefield’s approach where bbcode is stored in the post itself.


Reading through this, I am excited about the idea of being able to select some text and apply <mark></mark> code to it so it is highlighted. And also the ability to choose a highlight color or treatment. I often do this to draw attention to a key sentence in my posts. I also use <kbd></kbd> to refer to buttons in my posts.

But the place where I want to do this is in the composer when writing my post, not when I am reading posts. The quote/fast edit/share popup makes sense for those three actions but I don’t really see the point of adding a highlighter button there.

And why would each user have their own highlighter color? What’s the use case for that?

1 Like

How many times have I wished for a shortcut for this tag… :smile:

1 Like

Who knew?

It’s far afield from “civilized discussion”, but . …

Several people are working on, or thinking about, a particular document. The document is written and the discussion is about it. You might just want to highlight stuff in it just as you might have 20 years ago in a pile of bound paper called a “book.” Lots of times you’d want to highlight a section and quote it, but you might just want to light up stuff that you intend to think more about later.

1 Like

Here you go @Canapin GitHub - denvergeeks/Discourse-Keyboard-Text: A super simple component which allows quick <kbd> usage



BTW - There are 2 other Composer Theme Components that you can combine with the Highlighter.

Select just the Highlighter if you want to use the default highlighter color.


You can change both the text color and/or background color on-the-fly by selecting this other one


If you just want to change the text color change the text color on-the-fly by subsequently selecting @merefield’s Coloured Text component…

1 Like

Hey, I read the whole topic twice and I just don’t understand the difference between the two components and mark code!

Please, can anyone clarify what are the use cases you was talking about? A button on composer, adding it to the floating edit/quote popup or what else? :slight_smile:

We started to use a similar approach that <mark></mark> enables in our blog, so could be super intuitive to have the same on our forum.