[FIX] web_editor: inline space in source code

The prettifying of html when editing sources (user need to be in debug
mode to see the button) was removing too much spaces in some instances.

For example if someone got in a case such as:

  <span>hello<b> cruel </b>world!</span>

The spaces between text and tag would be removed (this would work fine
with the space outside of the tag).

This code add a special case so this doesn't happen anymore.

opw-743565
closes #17142
This commit is contained in:
Nicolas Lempereur
2017-05-22 11:06:50 +02:00
parent ea4d29351e
commit 57f7c68106
@@ -511,7 +511,12 @@ function prettify_html(html) {
level--;
}
result += token.trim().replace(/\s+/, ' ');
// don't trim inline content (which could change appearance)
if (!inline) {
token = token.trim();
}
result += token.replace(/\s+/, ' ');
if (inline_level > level) {
result += '\n';