[pmwiki-users] (:noteblock:) problem

Patrick R. Michaud pmichaud at pobox.com
Wed Apr 13 07:14:54 CDT 2005


On Wed, Apr 13, 2005 at 10:13:02AM +0200, Sebastian Siedentopf wrote:
> Am 13.04.2005 7:34 Uhr schrieb "Patrick R. Michaud" unter
> <pmichaud at pobox.com>:
> 
> > The HTML being produced by (:noteblock:) on your site is
> > badly broken with incorrectly placed <p> and </p> tags, and
> > that's probably what is causing IE so much trouble. ...
> 
> > I looked briefly at the (:noteblock:) code but it looks a bit
> > too involved for me to debug at the moment.  I suspect a well-placed
> > call to Keep(...) might resolve the problem.
> 
> 
> The table generated by something like this:
> 
> Markup('note','directives','/\(:note\s(.*?):\)/e', "notefct('$1')");
>   
> function notefct($Message){
>  $a="some <multiline wiki markup> text"
>  $b="some <multiline wiki markup> text"
>  
>  $out= "<table class='x'><tr><td  class='y'>".$a."</td></tr><tr><td
> >".$b.</td></tr></table>";
>  
>  return $out;
> }
> 
> should not be placed into <p> </p> tags.
> 
> I'm aware of the Keep() function but I have to admit, i haven't examined
> what Keep() is really doing and how it works, so it is probably my fault.
> Maybe there is a simple Keep() solution.  I will look after it.

Ah, this makes it easier.  In all probability the notefct() function
is returning a string that contains multiple lines, and these individual
lines are being processed for further markup (thus resulting in
paragraphs and other oddities in the middle of the table).

The Keep() function tells PmWiki "don't process this text any further--
send it as-is to the browser".

Try changing the call to Markup() to read:

Markup('note','directives','/\(:note\s(.*?):\)/e', "Keep(notefct('$1'))");

However, this doesn't fix (:noteblock:) itself, which contains
things that are spread across multiple lines (including paragraphs
and the like).  Getting that one to work is a bit tricky.

Pm



More information about the pmwiki-users mailing list