[pmwiki-devel] breakpage markup

Patrick R. Michaud pmichaud at pobox.com
Thu Apr 12 09:13:53 CDT 2007


On Thu, Apr 12, 2007 at 03:02:57PM +0100, Hans wrote:
> Thursday, April 12, 2007, 2:25:57 PM, Patrick wrote:
> > Your pattern probably needs to be
> >     /^#foxbegin/me
> > Without a /m flag, the ^ means "beginning of string", not 
> > "beginning of line". 
> 
> The beginning of line is not important.
> I tried the /m flag anyway, and it did not work.
> The markup was meant as a variation of your breakpage markup, trying
> to catch #foxbegin (the start of each fox post), break the page with
> it, and then display a number of posts according to a $PostsPerPage
> variable.

Easier might be:

  Markup('breakpage3', '>include', '#foxbegin', 
    'return FoxForumPageBreak($pagename, $x);');

Because the pattern doesn't begin with a slash, this indicates
to the markup engine that this rule is to be applied to any
text that has '#foxbegin' in it, and that the replacement code
is evaluated with eval().  $x refers to the current text.

Using the above, FoxForumPageBreak() can then modify the text 
however it wants, and whatever is returned is what will be 
passed to the remaining markup rules.

Does that help?

Pm



More information about the pmwiki-devel mailing list