[pmwiki-users] Trouble with ParseArgs

Ryan R. Varick rvarick at gmail.com
Mon Dec 12 13:15:30 CST 2005


As recommended in an earlier thread, I am using ParseArgs for the new
KOB directives.  I find that I multiple words are truncated, even when
wrapped in quotes.  I think it has to do with either (1) the second
argument I'm using for Markup or (2) slashes getting inserted into my
match.

The basic format is:

(:blogentry title="TITLE" time="YYYY-MM-DD HH:MM" permalink="GROUP.PAGE":)

I'm parsing this via:

Markup("blogentry", "directives",
  "/\(:blogentry\s+(.*):\)/e",
  "format_kob_entrystart('$1')");

Which gives the raw match to:

function format_kob_entrystart($match)
{
  $args = ParseArgs($match);

  // Vars set to args names
  ...

  return "($match) :: ($title) : ($time) : ($permalink)";
}

Given a test string:

(:blogentry title="This is the new format" time="2005-12-12 09:19"
permalink="BlogTest.20051212":)

Running it gives me:

(title=\"This is the new format\" time=\"2005-12-12 09:19\"
permalink=\"BlogTest.20051212\") :: (\"This) : (\"2005-12-12) :
(\"BlogTest.20051212\")

As you can see, the words are truncated, and slashes are inserted
before the quotes, which weren't there before.

A few questions:

(1)  How do I fix this?  ;-)
(2)  What is the second argument for Markup() all about?
(3)  Where are the slashes coming from?

Thanks,

Ryan




More information about the pmwiki-users mailing list