[pmwiki-users] Knowing line no. being processed

Peter Bowers pbowers at pobox.com
Tue May 11 15:23:54 CDT 2010


On Tue, May 11, 2010 at 4:33 PM, V.Krishn <vkrishn at insteps.net> wrote:

>
> Is there a variable that keeps track of line number of the wiki page being
> processed?
>
> Pmwiki is more "rule-based" than "line-number-based".  At certain stages I
believe the rule-processor does process a line at a time, but it's more
helpful to think of pmwiki as being a series of "smart search-and-replace"
operations that operate over the whole text -- line-by-line may occur, but
usually identifying the rule is much more important than identifying the
line.

If finding the rule would be helpful you can look in
http://www.pmwiki.org/wiki/Cookbook/DebuggingForCookbookAuthors and search
for "markuptohtml" --  you will find a way that can be helpful in
identifying which rule caused a certain change.  Do note the comments about
the size of the logfile and the slow-down it causes -- this is a temporary
debugging step rather than something that can be left in a live site...

If you already know the rule you are working with and need to know the line
number of the page text there may be something you can trace out in
MarkupToHTML(), but in looking through that function just now I can't find
anything line-based unless I'm just missing it...  ($text is typically a
string, not an array, as I read it, particularly when called from
HandleBrowse()...)

-Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20100511/825b981a/attachment.html>


More information about the pmwiki-users mailing list