How to Remove HTML Tags from Rich Text Output?

I’ve been using bubble.io rich text editor plugin to check keyword density, character count, word count, and paragraph count. However, the plugin’s output includes HTML tags, which interfere with accurate analysis. The HTML tags are counted in the results, leading to incorrect keyword density and character counts. Does anyone know how to remove these tags, perhaps with a Regex code or another method? I’ve attached a picture for reference.

Hi K, that should be possible. I am not an regex expert so just asked ChatGPT to provide a regex pattern for Bubble (since Bubble uses a simplified version of regex) which removes HTML tags (with or without spaces):<\s*\/?\s*[^<>]+\s*\/?\s*>

Note, It will also remove other tags like <bubbleisawesome>.

Hope it helps!

1 Like

Thank you for the solution, but it didn’t work.

Can you show where you implemented the regex and how you trigger it (a couple of screenshots)?

Here you go



Ah, the Rich Text element doesn’t use <html> tags, it uses BBcode which is [text between square brackets], so if you adjust the regex to something like \[.*?\] it should work.

Note, if you want to see the BBcode-tags in a textfield (Text RichtTextInput A in your screenshot), you need tot turn on ‘Do not apply bb-code’.

1 Like

it works!!
Thank you mahn :heart_eyes:

1 Like

Perfect! Small warning, it is kind of a blunt instrument because it will also remove [random text between square brackets]. If that is a problem it is really a matter of finding out what bb codes Bubble’s rich text input element uses and removing them using find and replace, adjusting the regex pattern or another smart solution (that we are not yet aware of :grinning:).

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