[pmwiki-users] Re: break-page.php adds blank lines

Sebastian Siedentopf schlaefer at macnews.de
Wed Aug 24 10:46:36 CDT 2005


Am 24.08.2005 um 16:54 schrieb Karl Loncarek (Klonk):
>
> OK found it:
> replace line 235
>         $new['text'] = $prechunk."\n".$new['text']."\n".$postchunk;
> with
>         $new['text'] = $prechunk."\n".$new['text'].$postchunk;
>
>

I'm not comfortable with this. Because you can come from

     ====
     !test
     ====
     !test2

and end up with

     ====
     !test====
     !test2

a) it's only lazyness that ==== also work in the middle of text, and  
not only at the beginning of a line
b) it's much more confusing to look at every edit if there is an  
empty line, then deleting the empty lines (which pmwiki ignores  
anyway, are filled up by normal editing too and you don't really see  
if you use section editing only) every now and then.

We use it for over six months now, and you are the first who noticed  
this at all. ;)

> But you should mention in the description that all the sections should
> end identically. Best would be an empty line. Alternatively "===="  
> should
> be be preceeded by an empty line.

Would be possible, but I guess everybody besides the script authors  
will forget this five minutes after reading.

If you find the blank lines really annoying I would change it to

    new['text'] = $prechunk."\n".rtrim($new['text'])."\n\n".$postchunk;

for the moment which always gives you

     ====
     !test

     ====
     !test2


> For the still showing e.g. "?p=2" in the URL after edit
> replace line 266
>         Redirect($pagename, "\$PageUrl?p=$n");
> with
>         Redirect($pagename, "\$PageUrl");
>
> @Schlaefer:
> would you please change that in break-page.php. I could do it  
> myself, but
> I think I shouldn't change anything without you knowing what was  
> changed.

No problem with this.

Sebastian




More information about the pmwiki-users mailing list