Highlighting text in different colours

Hi there, I have several very long word lists. I would like to be able to highlight selected words in different colours, is there a straightforward way to do this? Many thanks, Matt

Hey MF.

If you are just editing the selected words you can wrap them in in @@double at signs@@ which will highlight them in yellow.

If you want other colours you will have to specify it with a style attribute such as

@@background-color:lightpink;Text with custom style@@

Hi there, thanks, is there a way to add a button to the editor toolbar with a dropdown list of colours to do this? Matt

This is a bit trickier but doable…

You can start by cloning one of the other editor buttons - like $:/core/ui/EditorToolbar/bold - and after you change the description, caption, icon etc you could change the action-widget in the text field to be something like:

<$action-sendmessage
	$message="tm-edit-text-operation"
	$param="wrap-selection"
	prefix="@@"
	suffix="@@"
	trimSelection="yes"
/>

This will create the yellow highlight… There may be a way to have a dropdown set a colour - but that requires a bit more tweaking of the action setting… Let me keep tinkering - BRB

1 Like

Try the Shiraz Formatter sub-plugin in Shiraz Formatter 0.6.0 — editor buttons and snippets for Shiraz

2 Likes

@wikster thanks, that’s the kind of thing that I was looking for :grinning: