Replacing textarea bold and italic to html tags

Long time ago already solved this in Kirby 2, now looking for way in Kirby 3 to edit and replace provided ** (bold) and * (italic) asterisk symbols in panel textarea editor to html tags:

<b></b> and <i></i>

Im passing content as JSON directly to frontend (React) and text already with html tags would be very useful.

I want on button “B” press that selected text is wrapped with html tag not with double asterisk.

Are you using the API or custom endpoints?

Using custom endpoints with custom API. One option is to do iteration and replace to html tags before returning API response, but in Kirby2 did it by modify panel text editor function… can not find where to do it in Kirby3

What do you mean?