XF 2.2 Courier New font works while editing, deletes multiple consecutive spaces while saving post

Joao Prates

Active member
OK, so this one is weird as hell...

When trying to copy a post written in Courier New (fixed size font) from another forum into xenForo:

1606677294735.webp

... It all seems to go well while editing the post, by selecting the text in the table and setting it to Courier New font:

1606677344649.webp

... however, as soon as I press "Save" this is what it gets posted:

1606677398876.webp

It seems like every sequence of multiple spaces is transformed into a single space, and the rest is preserved, it's freaking crazy I can't understand why this is happening.

Can anyone explain what am I doing wrong so that I can fix it, or is this a bug?
 
In terms of how HTML renders by default, multiple spaces automatically collapse into one. XF doesn't do anything to change that. This will appear while editing but it won't be reflected in the final post. This is generally expected.

Out of the box, the only way to opt into an approach that maintains raw whitespace is via [CODE] tags. This also means that lines don't wrap unless you explicitly insert a line break.

If you don't wish to use code tags to accomplish this, you could potentially create a custom BB code that wraps the content in <pre> tags or otherwise apply CSS that changes the standard HTML behavior.
 
Back
Top Bottom