[pmwiki-users] (:include ... lines=

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 21 10:37:18 CST 2005

On Sun, Nov 20, 2005 at 06:54:13PM -0500, Henrik Bechmann wrote:
> For the (:include:) directive with the lines=n parameter, if the nth 
> line is the last line in the wikitext, and is not ended with a "\n" 
> (newline) it is not picked up by the (:include:) directive. I believe 
> this qualifies as a bug (unless, of course it is a feature<grin>).
> In my (:includefieldpage:) directive (which is starting to work -- 
> you'll see more of it soon, for any who are interested) which copies and 
> modifies the IncludeText() function, I have corrected the problem with
>       $itext = @$ipage['text'] . "\n";

You're probably right that it's a bug.  But the correction above
is probably also a bug in that it adds a newline where none
originally existed in the markup text.

I think the correct fix is to get the lines= argument to accept that
the last line might not have a newline on it (but not add one in
the process).


More information about the pmwiki-users mailing list