[pmwiki-devel] Strange keywords and description behavior...

The Editor editor at fast.st
Wed Apr 4 16:22:42 CDT 2007


I'm noticing some rather buggy behavior after all with the new ZAP
attr extensions.  Can't explain.

When someone enters:

(:zap attr_keywords="Key1,Key2,Key3":)

ZAP is supposed to either appends (:keywords Key1,Key2,Key3) to the
page or substitutes the new value if its already set somewhere on the
page...

Heres' the critical two lines....

if (strpos($newpage[text], "(:$attr ")) $newpage['text'] =
preg_replace('/\\(\\:'.$attr.'(.*?)\\:\\)/s', "(:$attr $value:)",
$newpage['text']);
else $newpage['text'] = $newpage['text'] . "\n(:$attr $value:)";

Then of course I update the page content.  Nothing else really.  (In
my case I resave the form once for each instance of the command)

I use the {(attr keywords)} markup to retrieve the information also...

Unfortunately, while the text shows up neatly like it should in the
wiki source, the actual page source gets royally messed up.  Adds line
breaks to the description line (which breaks the input markup) and
then doubles the last keywords entry, and keeps one copy of the first
set.  Very bizarre.

I thought it might just be a glitch in my markup but checking the
actual text content of the page it's all there.

Any idea what could be causing this?

Cheers,
Dan



More information about the pmwiki-devel mailing list