I am pulling content from an API (JSON) and I want to remove everything that’s after a new line. This is a snippet of what it would look like in the API:
...
"text": "In pellentesque massa lorem, nec feugiat risus dignissim ac.\n\nMorbi justo felis, scelerisque vitae ligula sit amet, porttitor molestie sapien. Pellentesque tristique nisl et leo hendrerit consectetur.",
...
When I use the Text element on Bubble to display the data, this is what it looks like:
In pellentesque massa lorem, nec feugiat risus dignissim ac.
Morbi justo felis, scelerisque vitae ligula sit amet, porttitor molestie sapien. Pellentesque tristique nisl et leo hendrerit consectetur.
What I want to do is only display the first line from the text
field, so it can look like this:
In pellentesque massa lorem, nec feugiat risus dignissim ac.
I was thinking about using :extrax with Regex
function, but I haven’t been able to find the right regex. Unless, there is a better method of handling this.