nl2br improvement

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

Re: nl2br improvement

Post by Timbalu »

Oh it does work well with my local 1.5.4 installation. When did it change to support the new lang method?
Ok here your are
edit updated zip of first post
Last edited by Timbalu on Sat Apr 09, 2011 8:55 am, edited 1 time in total.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: nl2br improvement

Post by Timbalu »

After so many people having such a big discussion :wink: - what shall we do with it?
It is a small improvement, using default nl2br, so I would pleg for upload.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: nl2br improvement

Post by garvinhicking »

Hi!

Come on guys, someone must be using nl2br and be annoyed by its current workage. YellowLED?! ;-)

I still wasn't able to test it on my own, I'm sorry...

(I really try to look at it, and even if I don't manage to do it before 1.6 [which I hope will not happen], I'll upload it to Spartacus at the very least. :-) )

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Re: nl2br improvement

Post by Mangek »

I'm perfectly fine with it. (really?! :shock: )

Well, because my entries are mostly just one image and text, it's working just fine. ;) I even changed to using <p> instead of <br> after updating to your version, Timbalu. :D
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: nl2br improvement

Post by Timbalu »

Mist, another one hopping to P - I hope not because of the new ISOBR ;-)
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Mangek
Regular
Posts: 85
Joined: Tue Jun 24, 2008 1:08 am
Location: Sweden
Contact:

Re: nl2br improvement

Post by Mangek »

Timbalu wrote:Mist, another one hopping to P - I hope not because of the new ISOBR ;-)
Nah not really, it made no change to my entries. Just made the code look neater, I suppose. ;) And I suppose paragraphs should use the <p> tag anyways, so. :)
onli
Regular
Posts: 2836
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: nl2br improvement

Post by onli »

Ian, why don't we try to improve nl2p instead?
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: nl2br improvement

Post by Timbalu »

Hi Malte
I did not try to do, since you can already do things like <nl>inside no parsing</nl> with it, when specifying <nl> as a example prevent tag, I assume. I just tried to have some sort of isolation for br too.
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: nl2br improvement

Post by Timbalu »

Update: added 4th version (2.11) on 2011-07-05
in special cases there was a leftover, which made editors with foldable Textblocks stumble
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
Jragon
Regular
Posts: 8
Joined: Sat Sep 10, 2011 2:52 pm

Re: nl2br improvement

Post by Jragon »

Thanks for the plugin, it's just what I needed

But why not change <nl> to <pre> 'cos that's basically what you're doing...
Timbalu
Regular
Posts: 4598
Joined: Sun May 02, 2004 3:04 pm

Re: nl2br improvement

Post by Timbalu »

Yes, but an hardcoded existing tag would'nt be as free as a non-existing-tag like <nl>. Imagine someones is using pre without code syntax and just wants normal line breaks inside...
Regards,
Ian

Serendipity Styx Edition and additional_plugins @ https://ophian.github.io/ @ https://github.com/ophian
yellowled
Regular
Posts: 7111
Joined: Fri Jan 13, 2006 11:46 am
Location: Eutin, Germany
Contact:

Re: nl2br improvement

Post by yellowled »

Timbalu wrote:Yes, but an hardcoded existing tag would'nt be as free as a non-existing-tag like <nl>.
You'll have to change that if XHTML2 ever becomes a standard, BTW.

http://www.w3.org/TR/2004/WD-xhtml2-200 ... #sec_11.2.

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

Re: nl2br improvement

Post by Timbalu »

Oh my god....! :) Thank you, YL.
Will it ever? To short I know, but I thought HTML5 is avoiding the further need of XHTML? It still would need someone writing entries in xhtml2, which should be extremely rarely, I assume. But I keep that in mind changing to something like <nonl></nonl>.

******btw******
What I have in mind would be some kind of hook via the nl2br plugin, integrating a BBC button for this element into the BBC row of the normal non-wysiwyg-editor 'frame'. If someone has an idea how to code this, please drop me a notice.
Regards,
Ian

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