Elxis CMS Forum

Support => Elxis 4.x/5.x DEV => Topic started by: seadhna on September 20, 2017, 10:49:12

Title: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: seadhna on September 20, 2017, 10:49:12
Hi datahell,
I've just done a fresh installation of the latest version, but I notice that the CKeditor is rewriting every <br /> as a space when I save an article.
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: webgift on September 20, 2017, 11:22:38
Hello,
Do you write articles using source code or once you need new line break you type
shift+enter? Have you tried <br> instead of <br />?
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: seadhna on September 20, 2017, 17:15:48
Hi, yes, I write using source. If I type <br> or <br /> and click 'Apply', it is replaced with &nbsp;
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: datahell on September 21, 2017, 00:09:23
Yes, the editor does some similar replacements if the HTML is invalid or depending on its configuration.

Tip: use <br /> instead of <br/>
note the space after "r".
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: seadhna on September 21, 2017, 14:11:26
Hi datahell,
I am writing <br /> with the space. It is getting rewritten when I click 'save' as &nbsp;
Note, this happens only in the default language I have noticed today. It does not happen in secondary languages.
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: seadhna on September 21, 2017, 14:12:29
Also: If I type <br /> outside of any parent element, it gets rewritten by the CMS as &nbsp;
If I type <br /> inside of a parent element, e.g. <div> or <p>, it simply disappears.
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: seadhna on September 21, 2017, 18:50:39
Actually, it happens for other languages too. If I type <br /> and click the save-disk for that language, it's ok, but when I click the main 'apply' or 'save' button, it disappears.
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: datahell on September 21, 2017, 21:00:43
break is an old-fashioned tag and the editor makes some replacements but this depends where you have put it. If you insert it inside a paragraph tag it will stay intact. If you put it outside a paragraph it will be replaced by an empty paragraph because it is not good to use breaks for space. If you want to add down space use css margins instead.
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: seadhna on September 22, 2017, 11:13:14
Hi datahell,
<br /> is not an 'old-fashioned' tag! It is a critical tag, required and the most correct tag in multiple situations.
It is perfectly valid and it's removal by the Elxis CMS is a bug, not a validation.
Please understand it is not being replaced by an empty paragraph, it is being removed and not replaced with anything! This makes the CMS unusable for my purposes.
Title: Re: Latest version of Elxis rewriting <br /> as &nbsp;
Post by: seadhna on September 22, 2017, 12:47:00
Here is an example of why I need <br /> outside of a <p> tag:

I have two headings, they must be "display:inline" in order to feature a 50% opacity background shading and have the necessary 'padding' left and right of a mult-line heading. (There are numerous browser issues relating to making this possible, and 'display:inline' is the best solution at present. More available on this here: https://css-tricks.com/multi-line-padded-text/).

<h1 class="with-bg">Malawi:</h1>
<br />
<h2 class="with-bg">Building Resilient Systems for Food and Nutrition</h2>

The thing is: These headings, semantically, are the same heading. To overcome the current issue with Elxis, I must style a <p> class with zero height thus:

<h1 class="with-bg">Malawi:</h1>
<p class="line-break">&nbsp;</p>
<h2 class="with-bg">Building Resilient Systems for Food and Nutrition</h2>

However, this is not as elegant and semantically incorrect, because these two headings are in fact part of a same overall heading and should not be divided by a paragraph, merely a line-break.