Is there a way I can make and apply custom HTML styles (HTML tags to put before and after selected text) onto text?

What I’d like to do is create HTML elements like, here are two examples:

<span class="class1"></span>
<span class="class2" style="color:red;"></span>

I then want to select text, and apply a command (either from the command palette or with a hotkey) to apply one of those elements above; put the text inside on of those HTML elements. Similar to how when you press CTRL B, it makes text bold by puts ** before and after the text (the markdown syntax for bold text).

It might be doable with the Templater community plugin (I don’t use it so I’m not totally sure).

Maybe something like this?

Oh this works very well, thank you!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.