e107help.org Q&A
0 like 0 dislike

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:

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

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
asked in Core by (26 points) 2 3 5
reopened by
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.
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.
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.
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

0 like 0 dislike
Best answer
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.
answered by (26 points) 2 3 5
selected by
Or you could insert your code in a raw textarea and not in the WYSIWYG editor.
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?
0 like 0 dislike
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:

https://github.com/e107inc/e107/commit/489fb66d650b90d3ca6a8e10ace894ab030121c2
answered by (2.3k points) 6 10 18
Welcome to e107 Q&A, where you can ask questions and receive answers from other members of the e107 community.
744 questions
1,154 answers
1,963 comments
1,179 users