Need Trim() to work for links

It seems like Coda doesn’t treat links as rich text for some reason.

I have a table where 1 column contains user-generated text for its rows (generally rich text and they always have links at the end). Another column uses a simple formula to clean the user-generated text in the first column. The formula I use is thisRow.UserTextCol.Trim() to simply remove leading and trailing whitespaces. Unfortunately, if there is a link at the end, it is completely stripped off. Here’s an example:

Support said that Trim() works as expected since it outputs text, and links are not text. This seems odd since Trim() preserves rich text within the content itself. It’s also odd since I haven’t seen this type of rich text behavior in other content management platforms.

Anyone know of a way to get around this in the formula itself (vs. creating a separate col of links + concat)?

Hi @Gideon_Thomas,
and welcome to Coda Community! :handshake:

Would it be possible for you to share a sample in order to have a deeper look?
Thank you!

Thanks :slight_smile: I updated the post above (hope I did it right) with an example.

Hi @Gideon_Thomas,
thank you: just asked for permission.

Hi @Gideon_Thomas!

The current functionality of the Trim() formula is certainly non-ideal in this use case. I have come up with a formula workaround that should solve the problem:

Hope this solves the problem. Let me know if you have any questions!


Amazing! Thank you for this creative workaround!


Very clever @noah and thank you for explaining it above, great to read through and learn a new approach with Middle().

1 Like