Forum Academy Marketplace Showcase Pricing Features

Conditional formatting of some words in a long text [regex?]

Hi, I have a custom state, a list, that contains N usernames
The user writes a post into a multiline input and mentions one of the usernames in the custom state by typing @. I’m doing this via a plugin named WGD Mentions. The results is a long text that contains one more “@username”.

I would like such mentions to appear in bold. How can I do it?
Find and Replace cannot be used because I have a list and not an exact text to be replaced.
I suppose I should use Regex but I’m not familiar. It should say “each time you find a word that starts with @, format such word in bold”.

Besides setting the mentions in bold in the output text, is there a way to format the mentions also in the multiline input while I’m typing?

Thanks in advance for your help.

Hello! I recommend taking a look at the following forum posts, where users have solved similar questions:

As noted in the first of these two posts, Bubble doesn’t currently support Regex flags, however you may be able to use one of the workarounds mentioned in these posts.

1 Like

Hi Rachel I checked those threads but couldn’t solve my problem

I have a text showing

Lorem ipsum #dolor sit amet

and I would like it to be rendered as

Lorem ipsum #dolor sit amet

(I’m using character # as @ here in this forum gets always bolded)

Do you have any suggestion? Thanks in advance.

This topic was automatically closed after 70 days. New replies are no longer allowed.