Targeting tags with specific text

I’m trying to create a win and a #lose tag. I want the win to be green and the red to be lose.

So far, I have been able to capture read mode with this

a.tag[href="win"]

and I get my desired output

image

However, I would like the same, or at least similar in edit mode. When I do this:

.cm-hashtag.cm-tag-win

as my selector, I get this:

image

And obviously it is still treating it like the begin and end parts individually. But the thing is that I can get it looking right with just

cm.hashtag

but obviously there is no selection of the text. Any ideas how to select for given text while applying just the cm.hashtag css?

Custom #tags in the editor need a bit more work. :muscle:

Hopefully these topics:

and this Discord discussion (scroll down to FireIsGood’s solution as well) can help.

Nice one, thanks very much!