+5
Under review

Please make HTML block keep its hard returns

Nick 9 years ago in BLOX CMS updated by Patrick O'Lone (Director of Software Development) 8 years ago 5

Some of us are OCD about how our code looks. So it's somewhat of an exercise in frustration when creating an HTML block to then have the system remove hard returns. I don't see any rhyme or reason as to what it removes. It does save tabs(or four spaces) which is good but hard returns are really a crapshoot.

+1

Another issue I've dealt with when using the HTML block is special characters. When I put in © and save it everything looks fine. But when I open it back up it has © instead of the html code. If I edit something and save it the © becomes Â. Any future edits result in more Â.

+1

I wouldn't directly insert special characters like that in HTML, it's technically not supposed to be inserted that way, just use HTML entities instead. So for ©just use "& copy;" (without the space)


Here's a list of HTML entities on WIkipedia

Ditto. The editor should be smart enough to parse the special characters without having to resort to the character codes.

Under review

Issues with saving multi-byte characters in the editor view was correct a release or two ago. Testing of hard returns looks like they are preserved - are you still experiencing issues with that?


The HTML block is forced through a clean-up process using a library called Tidy to make sure that it is sanitized HTML to prevent the page from breaking. This is a standard problem in the HTML asset which is why there is also a future change coming to that to modify it's behavior to also be sanitized.