Strings are stripped of extra spaces (whitespace collapse)

When I have a value in an object that is a string with extra spaces, those extra spaces get stripped when I access the object's value.

For example, I have a transformer that returns "hello. ____ there"

Screen Shot 2022-09-08 at 6.11.16 PM

But when I look at the value, it's "hello. there"
Screen Shot 2022-09-08 at 6.12.07 PM

Where are the extra spaces???

hey there!

I confirmed that these spaces are truly stripped when used in a component. Could you explain your use case for needing the extra spaces? With your input we can file a feature request ticket to add an option which prevents the stripping of additional spaces! :grinning:

I construct a formatted string in the back end and want to display it in a text box.

All my formatting goes away at the moment.

hey @rmirchandani, are you only formatting your string using extra spaces? Are there any additional changes you're making? Could you share a screenshot of your set up and what you're seeing?

Hi Kenny,

this issue was resolved by puttin

"< pre >"< /pre >"

around the text in the markdown where I was displaying it. I guess that's the html for "don't strip whitespaces in the text"

Thanks so much for sharing that! This will be super helpful for other users encountering this problem. :smiley:

Additional context:

The <pre> HTML element represents preformatted text which is to be presented exactly as written in the HTML file. The text is typically rendered using a non-proportional, or monospaced, font. Whitespace inside this element is displayed as written.