WYSIWYG editors clears CLEAR=BOTH and similar tags

Found a bug? Tell us!!
Post Reply
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by Huhu »

Logged in as Administrator, with filters switched off and only the Serendipity and NL2BR Formatting active (meaning that nothing should be filtered or stripped off the code), the WYSIWYG editors clear certain tags.

1. CKG editor clears the complete

Code: Select all

<iframe>...</iframe>
of Google map embeds.

2 a. S9y's built-in editor clears certain "style=" tags, like

Code: Select all

<p style="clear: both">
which will result in a simple

Code: Select all

<p>
for example (also in Source Code view).
Note that it does not clear all "style"-tags, image resizing through "style" works fine, for example.

2 b. Strangely, when I switched from S9y WYSIWYG to Source Code only in the User Options, the missing style tags suddenly reappeared (this might be a strange cache issue, though).
Last edited by Huhu on Thu Jul 22, 2021 7:00 pm, edited 1 time in total.
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Afaque
Posts: 1
Joined: Sun May 19, 2019 9:35 am

Re: WYSIWYG editors clear certain HTML/CSS tags

Post by Afaque »

Hi New to s9y here...figuring out still...as far as I understand the bug for now i think you have to change plugins author from ALL Authors to Site owner to not get html/css tags to be cleared.Still newbie sorry if i was wrong!
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clear certain HTML/CSS tags

Post by Huhu »

The core WYSIWYG editor is not a plug-in afaik, therefore the owner can't be changed, sorry.
it could be Serendipity's Text Formatting plug-in which messes around, though. That could be changed.
But thanks for the reply.
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clears CLEAR:BOTH and similar tags

Post by Huhu »

Still running into teh problem that I can't sort <div> areas velow each other, since

Code: Select all

<p style="clear:both;">
and similar approaches don't work (they are cleared upon save, and yes, I am logged in as admin).
problem even turns up when embedding a centered image under a div tag (images usually do work fine when inserted via media center and "center" value).

Any ideas and solutions?
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by onli »

You could try the configuration of the editor as it is in the current github master. Make a backup of your htmlarea/ folder, then replace it with https://github.com/s9y/Serendipity/tree/master/htmlarea.

It could give you a newer version of the editor and some configuration changes that might help.

If it doesn't we could tweak the settings again, reproduce the issue in a dev environment and see how it can be solved.
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by Huhu »

Brilliant, I'll give it a try!
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by Huhu »

Quick question, the updated version of the editor including the preservation of "clear:both" styles is not yet integrated in updates, right?
Which way would be recommended to achieve a clear:both (to get a hard line break after images, for example)?
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by onli »

Did the version from the github master back then work for you, or was the editor still broken with that one?
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by Huhu »

I tried it with

Code: Select all

<br [and p] style="clear: both;">
and both worked! It seems I had tried a derelict version before.
So yes, your current version seems to do the trick. What would be great would be a button to click in the WYSIWYG toolsbar to insert a p clear or br clear.

But as long as coding it in by hand works, it's already fine for me. Thanks!!
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by onli »

Maybe not all that derelict, I did change the configuration somewhat recently again together with the changes for PHP 8 :)

It's good that this work now! I'm not sure about the buttons, this is a bit specific. You could add them on your own of course - https://github.com/s9y/Serendipity/blob ... it.tpl#L14 shows how commands can be added easily as a button, together with some documentation specific to ckeditor using that to insert an html tag should be doable.
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by Huhu »

Thanks, and thanks for pointing me to the document for button integration. Looks straight enough, I'll give it a try!
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by Huhu »

Just ... here is an example for the problems with div-tags and clear both=all. When I wrote the CSS, it appeared in order. After updating the site via the WYSIWYG, it all got a bit ... messy.

(the title box should be in a separate line, the "Leseprobe" and "Bestellen" should be side-by-side in a separate line).

https://uhusnest.de/index.php?/archives ... l#extended
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
onli
Regular
Posts: 2822
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by onli »

Sp you had added clear:both to .buchlink and the p tag after .litverweis, but the editor again removed both?
Huhu
Regular
Posts: 157
Joined: Tue Oct 04, 2011 3:22 pm

Re: WYSIWYG editors clears CLEAR=BOTH and similar tags

Post by Huhu »

Well first of all, the WYSIWYG adds a "<p>&nbsp;</p>" code between </div> and the follow-up<div>, even if an area is not changed. Strangely, not always.
Next, I added "clear: all" to .buchlink in css, but it didn't help; the div is still wrapped with other text.
If I write p style="clear:all", the style tag is removed by the editor (WYSIWYG only).

So, this is correctly displayed:

Code: Select all

<div class="litverweis">Der Dimensionsblock,[...]</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Die AMUNDSEN [...]
But this is displayed wrapped, while it seems to be the same code-wise ... I'll have to check again if there is a loose div or /div somewhere ... :

Code: Select all

<div class="litverweis">Die Geminga-Morde, ...</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Ende ...
as well as this:

Code: Select all

<div class="buchlink">[...] Perry Rhodan-Webseite[...]</div>
<p>&nbsp;</p>
<div class="litverweis">Die zerborstene Welt [...]</div>
<p>Auf der [...] Ganze gar keinen Spa&szlig;.</p>
<p>&nbsp;</p>
And here, again, both pairs of boxed are one after the other, but the pairs themselves are not cleared but chained together (while the second pair is shifted down a bit by an auto-inserted <p> tag)

Code: Select all

<div class="buchlink">Leseprobe</div>
<div class="buchlink">H&ouml;rprobe</div>
<p>&nbsp;</p>
<div class="buchlink">Interview: </div>

<div class="buchlink">Bestellen</div>
Post-apocalyptic Jugger sports: What is Jugger? Video I Free ebook on the sport
Post Reply