Custom styles in text editor - Add class to <p> or <span> tags

What is the best way to add custom styles to a text area in Kirby?

If I have 2 paragraphs of text and wish for the first para to have a class of ‘intro’ how would you do this? I don’t want to have 2 separate text files for each paragraph.

Another scenario is to highlight a few words in the middle of a paragraph and give them a custom class with a tag wrapped around them.

All the above would need to be simple for the client to do for themselves too.

I assume the current markdown editor isn’t capable of this, so what other methods do people use?

You could get the first paragraph via some regex, see this old example: Variable-length excerpts possible? - #5 by texnixe

As with highlighting single words, you would need some way of marking them up, either by adding custom marks to the GitHub - fabianmichael/kirby-markdown-field: Enhanced markdown editor for Kirby 3, community built. or using kirbytags or even HTML

The intro can also be selected with CSS:

.text p:first-child { … }