Page 1 of 1

OpenCart 3 native WYSIWYG editor bad html

Posted: Fri Dec 22, 2017 8:30 pm
by emollusion
Hi!

I have had to manually edit the html for my information pages. This due to a really extensive HTML write out by the WYSIWYG editor. It is kinda like it takes what the CSS says, and then puts it in html. But worse.

Examples:
<p style="line-height: 1.2; margin-top: 0pt; margin-bottom: 5pt; background-color: rgb(255, 255, 255);" dir="ltr"><span style="background-color: transparent; font-family: Arial; font-size: 20pt; white-space: pre-wrap;">HEADLINE</span><br></p>

<p style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" dir="ltr"><span style="color: rgb(0, 0, 0); font-family: Arial; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: 400; text-decoration: none; vertical-align: baseline; white-space: pre-wrap; background-color: transparent;">ROW TEXT</span></p>

<p style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" dir="ltr"><span style="font-family: Arial; font-size: 14.66px; white-space: pre-wrap;">ANOTHER ROW TEXT</span><font face="Arial"><span style="font-size: 14.66px; white-space: pre-wrap; background-color: rgb(255, 255, 255);"> </span></font></p><p style="line-height: 1.38; margin-top: 0pt; margin-bottom: 0pt;" dir="ltr"><font face="Arial"><span style="font-size: 14.66px; white-space: pre-wrap; background-color: rgb(255, 255, 255);"><br></span></font>

<h1 style="line-height: 1.2; margin-top: 20pt; margin-bottom: 5pt; background-color: rgb(255, 255, 255);" dir="ltr">HEADLINE<br></h1>

This is what I get in code view after writing in the wysiwyg editor. Cleaning this up, and making the text appear as it is supposed to is a real hassle.
What can I do about this?

Thank you!

Re: OpenCart 3 native WYSIWYG editor bad html

Posted: Fri Dec 22, 2017 9:29 pm
by straightlight
Posted in feedbacks regarding bad HTML codes. Although, no OC version posted.

Re: OpenCart 3 native WYSIWYG editor bad html

Posted: Wed Jan 03, 2018 7:41 pm
by emollusion
What has the wysisyg in OpenCart to do with the forums user contributed errors?
Specific opencart version is 3.0.2.0, if this was your question.

Re: OpenCart 3 native WYSIWYG editor bad html

Posted: Thu Jan 04, 2018 2:52 am
by IP_CAM
This due to a really extensive HTML write out by the WYSIWYG editor.
Well, you did not mention, if you created your Code in the SOURCE View or
in the Wysiwyg View, wich would be comparable to entering plain HTML Code
onto a MS FrontPage Wysiwyg Screen.

Otherwise, the unfamous OC-2/3 Editor, as well as some older ckEditors, had
some problems with changing SOURCE, when saving the Content in OC. And
it also depends on, wich way one saves the Code, if saved in Source Mode, some
keep the format, as entered, but it always has been a trail & error Game, to recall,
with Editor I used before, to avoid such problems, when, by example, adding a simple
class="img-responsive" Code to an image/banner source, to make it look swell
in all resolutions.

But ckEditor's seem to exist for all later OC-Versions, I would try one of those, to
possibly solve your Problems.
Good Luck! ;)
Ernie

Re: OpenCart 3 native WYSIWYG editor bad html

Posted: Wed Feb 21, 2018 2:23 am
by qahar
Editors usually have Paste as Text option to remove html tags from external source (site page, file document, pdf etc).

If it's not available paste the content to text based editor (notepad or vim), copy again and paste to editor in WYSIWYG mode.
The worse outcome each paragraph separated with <br> instead of wrapped in <p> tags; use view source to see it.