Adjust size of images when displaying from rich text

I found a solid way of showing 100% wide images in a text element (which pulls rich text, including images, stored in a text field). You need to do this as you save the rich text.

For my process, I Save the Bubble Rich Text’s input and use this :find&replace (with regex) as I save it. The text element then shows the image, no matter what size of the source image and the group, at 100% of the available width

From ChatGPT:
You can use a regex with capturing groups to match any width value. For example, if your tags are in the format [img width=NUMBER], you can use this regex:

  • Find: (\[img width=)\d+(\])
  • Replace with: $1100%$2

Explanation:

  • (\[img width=) captures the opening part [img width=
  • \d+ matches one or more digits (the variable width)
  • (\]) captures the closing bracket ]

The replacement string uses the first capture group ($1), then inserts 100%, and finally adds the second capture group ($2), resulting in [img width=100%] for every match.

Adjust this regex if your image tag structure varies.