[Pmwiki-users] Re: custom wikistyle -- help?
Patrick R. Michaud
pmichaud at pobox.com
Mon Jan 24 16:30:15 CST 2005
On Mon, Jan 24, 2005 at 01:42:27PM -0500, Bronwyn Boltwood wrote:
> Markup('[[->','>[[|',
> "/(?>\\[\\[([^\\]]+?)\\s*-?+>\\s*)(\\S.+?)\\]\\]($SuffixPattern)/e",
> "Keep(MakeLink(\$pagename,PSS('$2'),PSS('$1'),'$3'),'L')");
> It's fine while the Markup rule is enabled, but it does the
> end-of-script thing when I comment it out.
Oh, I missed this aspect of your original post. If you comment out
the above, to get
# Markup('[[->','>[[|',
# "/(?>\\[\\[([^\\]]+?)\\s*-?+>\\s*)(\\S.+?)\\]\\]($SuffixPattern)/e",
# "Keep(MakeLink(\$pagename,PSS('$2'),PSS('$1'),'$3'),'L')");
then the ?> is no longer part of a string -- it's part of a comment,
and PHP still treats the ?> as being an end-of-script marker.
The truth is that the ?> here is just a regular expression optimization,
so you can write
"/\\[\\[([^\\]]+?)\\s*-?+>\\s*(\\S.+?)\\]\\]($SuffixPattern)/e",
and it will work whether it's commented or not.
Pm
More information about the pmwiki-users
mailing list