old entries, switching (non/wysiwyg) Editor mode

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

old entries, switching (non/wysiwyg) Editor mode

Post by Timbalu » Sat May 25, 2013 7:05 pm

I just discovered a behaviour I did not think of before...

When having an existing blog running in non-wysiwyg-mode, all entry (default) ENTER breaks are stored as \n in the database.

So now it comes, someone wants to switch over to an Editor mode and enables the wysiwyg config option, the new situation won't recognize these old entries to be read as linebreaks, or <p>. Just imagine the one has some hundreds entries or even more...!
Vice versa - after some entries are made with the editor - it is no problem, since the new entries seem not to be touched by nl2br (whyever...).

Is that a Problem of my new Plugin, or my personal configuration, or has that been like this in every EDITOR "Plugin" before? I do not want a new discussion about the use and sense of the nl2br plugin, but this may hit many people out there, not being sure what they want to use (forever), wouldn't it?

Can anybody report some experiences with that?
If is, can we do anything persistent about it, without changing into a big mess?
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: old entries, switching (non/wysiwyg) Editor mode

Post by johncanary » Tue May 28, 2013 12:50 am

Hi Ian,

From day one since I use S9Y I am writing in plan text mode relying on the NL2BR plugin. I often use tags for lists or for embedding video, then I keep the text in one line from the start to the end tag to make sure NL2BR doesn't get in the way. I only very recently upgraded to S9Y 1.6.2. and now 1.7 and did not have the advanced config parameters like ISOBR, ... (still confusing to me) before. And I usually don't use the P-elements.

But I guess I am a rare bread, and I am happy to keep writing in plain text mode.

I switched to the editor a few times on single occasions temporarily in the past but I really don't remember the exact behavior with NL2BR. Was an older editor, S9Y 1.1.2 or older, old plugin, ...

Now, when looking at older posts in the editor it all collapses to a single block of text as you describe (I guess this is what you wanted to say).

If I had switched to WYSIWYG, I would not mind editing an old post accordingly (adding br's or p's) when necessary. You can switch to HTML mode and add BR tags or P tags by hand in sch a case. It's a quick fix. And the new posts are not a problem either nor are the old ones that do not need to be changed.

If the NL2BR functionality breaks some time in the future for some reason, I would at first do a quick fix in CSS for the front-end and probably think about cleaning up all my entries algorithmically a bit later.

Code: Select all

serendipity_entry_body {
    white-space: [pre-wrap|pre-line]
}
Yours
John
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: old entries, switching (non/wysiwyg) Editor mode

Post by Timbalu » Tue May 28, 2013 9:37 am

johncanary wrote:Hi Ian,

From day one since I use S9Y I am writing in plan text mode relying on the NL2BR plugin. I often use tags for lists or for embedding video, then I keep the text in one line from the start to the end tag to make sure NL2BR doesn't get in the way. I only very recently upgraded to S9Y 1.6.2. and now 1.7 and did not have the advanced config parameters like ISOBR, ... (still confusing to me) before. And I usually don't use the P-elements.

But I guess I am a rare bread, and I am happy to keep writing in plain text mode.
Well, me too. ;-)
Btw, ISOBR is easy. If it is ON (by default), you can just use the BBCode [NoBR] Button to prepend code or code parts you have written as html. This will then stay untouched by NL2BR, meaning: no \n linebreak (which btw is the product of clicking ENTER) in there gets converted to <br>. Thats it.
johncanary wrote:I switched to the editor a few times on single occasions temporarily in the past but I really don't remember the exact behavior with NL2BR. Was an older editor, S9Y 1.1.2 or older, old plugin, ...

Now, when looking at older posts in the editor it all collapses to a single block of text as you describe (I guess this is what you wanted to say).
Well yes and no. It was something like frontend views also, which I can not reproduce any more.... :o
If it would have been only in the editors textarea (which is like this in all wysiwyg-Editors!) or the preview, I assume, I would not have written this text... But as I said, I just had another try with Xinha Core, FCKeditor and the new CKEDITOR and my concerns are gone. Strange! (I did not check for dependecies with entryproperties, but flushed the browser cache, though...)

The nl2br Plugin checks each entry internally for the use of WYSIWYG and other MARKUP Editors, by 'disable_markups', 'ep_no_textile', 'ep_no_markdown', which is new (one year old) too. I had this in mind when writing the initial post.
johncanary wrote:If I had switched to WYSIWYG, I would not mind editing an old post accordingly (adding br's or p's) when necessary. You can switch to HTML mode and add BR tags or P tags by hand in sch a case. It's a quick fix. And the new posts are not a problem either nor are the old ones that do not need to be changed.

If the NL2BR functionality breaks some time in the future for some reason, I would at first do a quick fix in CSS for the front-end and probably think about cleaning up all my entries algorithmically a bit later.

Code: Select all

serendipity_entry_body {
    white-space: [pre-wrap|pre-line]
}
Yours
John
Yes. Thanks noting. But my point of view was from a developers perspective... To might have doing things like this was what I called starting into a big mess.... :wink:
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

User avatar
johncanary
Regular
Posts: 116
Joined: Mon Aug 20, 2007 4:00 am
Location: Spain
Contact:

Re: old entries, switching (non/wysiwyg) Editor mode

Post by johncanary » Tue May 28, 2013 10:20 am

Best way to not start a big mess: “Don't touch anything that works.”
… and thanks for explaining the ISOBR functionality.
Yours John
: John's Google+ Profile
: John's E-Biz Booster Blog powered by Serendipity 1.7/PHP 5.3.14

User avatar
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: old entries, switching (non/wysiwyg) Editor mode

Post by Timbalu » Tue May 28, 2013 4:02 pm

Timbalu wrote:Well yes and no. It was something like frontend views also, which I can not reproduce any more.... :o
If it would have been only in the editors textarea (which is like this in all wysiwyg-Editors!) or the preview, I assume, I would not have written this text... But as I said, I just had another try with Xinha Core, FCKeditor and the new CKEDITOR and my concerns are gone. Strange! (I did not check for dependecies with entryproperties, but flushed the browser cache, though...)

The nl2br Plugin checks each entry internally for the use of WYSIWYG and other MARKUP Editors, by 'disable_markups', 'ep_no_textile', 'ep_no_markdown', which is new (one year old) too. I had this in mind when writing the initial post.
Next ... (To the children: Don't do this on productive systems!) :wink:

If you have some old entries in non-js-editor mode and turn on the js-editor and then run cache-all articles (which is entryproperties), the "\n" does not get parsed by caching the articles in the database and are sent to the frontend like this. Prior, you had them in there, like test\n<br>test\n<br> and so on, depending on your NL2BR setup.

Being funny, turning off the WYSIWYG Mode in personal preferences and run the cache-all again, the messie-music starts to play, turning old entries back to normal, but further the js-based written entries using unwanted linebreaks.

As a consequence, (untested) having entryproperties cache turned off by default, this will directly happen to the frontend output, I assume.

So my origin question raises apart: Can we do anything persistent about it, without changing into a big mess?

EDIT: While building the 2.0-Alpha, we added a possible conflict nl2br handler note to the nl2br plugin config page!
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian

Post Reply