Extra line breaks in pages and news created using HTML

My biggest headache after upgrading e107 to v2 was forced translation newline characters to <br> tags. And I write pages and news almost exclusively in HTML, so pages with heavy formatting (like long tables) had so many line breaks accumulated that you have to scroll many screens before you reach the content.

I tried searching for a possible solution or at least someone with the same problem. It turned out this issue was fixed a few times, but it's still here for me, even in v2.1 released a few days ago.

To illustrate, here's an example. Let's say, I create a page with the following code:

<td>I am a single cell</td>

This is what the page generates when I visit it:

<table><tr><br /><td>I am a single cell</td><br /></tr></table>

Where did these line breaks come from? I didn't put them there. What do I do about it?

e107 version 2.1

fsLeg commented Mar 21, 2016

I mean that there's no difference for admin panel if I choose whatever way of editing, it only affects the main website. The browser shouldn't matter (it's Vivaldi), because it's the server that gives me the code with extra line breaks. I even queried the database to confirm that no explicit line breaks were present in the saved code.

Jimako commented Mar 21, 2016

I asked, because I have no problems with inserting your code. Default bootstrap theme. I do something different than you and I am only trying to find what is it. Admin panel - do you mean textarea for news body? You can insert your code as plain text, in body in textarea and via source code / tinymce button. If your data are saved correctly, I would look at your theme. Is this happened when you use default bootstrap 3 theme? Because for me not.

fsLeg commented Mar 21, 2016

I tried switching theme to a default Bootstrap one, but the problem is still there.

By admin panel I mean (for pages) Admin area - Content - Pages/Menus - Create Page/Menu (or edit an existing one). There's only one textarea there with no TinyMCE button or other options there, not that I need TinyMCE anyway (it is enabled in plugins for now).

Maybe something went somewhat wrong when I upgraded to v2, but I even tried to unpack a full installation (e107_2.1_full.zip) over the existing one, but that changed nothing.

Jimako commented Mar 22, 2016

I was tried news :) but my page admin area looks like this: https://github.com/Jimmi08/e107_snippets/issues/3 If you don't see Tinymce button, check if you don't have old tinymce3 folder there. You should have just tinymce4 in e107_plugins folder.

2 Answers


fsLeg Points26
HTML has to be inside [html] bb-code. For some reason that wasn't mentioned anywhere. Thanks to Jimako, whose hints indirectly led me to the answer.

septor commented Mar 23, 2016

Or you could insert your code in a raw textarea and not in the WYSIWYG editor.

fsLeg commented Mar 23, 2016

I did and it resulted in extra line breaks. I've never used TinyMCE before, and only after I enabled it I saw that it just adds [html] bb-code. I then disabled it, added the tag to all my pages and some news (too many news to add to all of them) and it fixed the problem. If anything, the problem here is that e107 parses HTML outside [html], which is misleading and turned out to be buggy. And even if it's intended behavior, then why does [html] bb-code exist?


Moc Points2127
Some improvements have been made in order to prevent this issue from happenign again when upgrading from v1 installations. The fix will be included in the 2.1.6 release and is already available on Github:


Please log in or register to answer this question.

Know someone who can answer? Share a link to this


e107 Q&A is a Question and Answer platform where e107 users can ask questions themselves and answer each others questions. By doing so users can earn badges and points and become e107 experts.

This community platform is a valuable tool for sharing and gaining knowledge on e107. Go ahead and find out yourself!

Connect with us