[pmwiki-users] Weird Error in Definition Markup

John Rankin john.rankin at affinity.co.nz
Thu Jul 13 18:10:06 CDT 2006


On Friday, 14 July 2006 7:45 AM, Kurt Devlin <kurt.devlin at gmail.com> wrote:
>It definitely is. Some careful commenting in my config.php
>revealed that it was some of my own custome markup that I
>added. Some users have been adding a lot of "cut & pasted"
>email responses (including the email headers) to our wiki
>pages. I added some markup so that it would take less editing
>to turn the names in the header into Profiles links.
>
># Markup directive to handle alternate name patterns for
>profiles. Uses [[~LAST, FIRST]] pattern
> Markup('alternate-profile','directives','/\\[\\[~(.*?),
>(.*?)\\]\\]/',"[[Profiles/$2 $1|$1, $2]]");
>
>This made it easy to turn
>
>    From: Devlin, Kurt
>    To: Michaud, Patrick R.
>
>into:
>
>    From: [[~Devlin, Kurt]]
>    To: [[~Michaud, Patrick]] R.
>
>instead of rearranging the first and last names myself. For
>example,
>
>    From: [[~Kurt Devlin]]
>    To: [[~PatrickMichaud|Patrick R. Michaud]]
>
>So when this pattern saw ":[[~Kurt Devlin]]:Lead for
>[[MyProjectA/]], [[MyProjectB/]]", it kind of lost it's mind.
>
>Do you have any ideas on how to tweak the pattern to save my
>initial concept and prevent this side effect?

I have had some success in this kind of situation using ([^\\]\\[]*?) 
instead of (.*?) -- explicitly forcing "any character except ] or ["


John
>
>Thanks,
>Kurt
>
>
>On 7/13/06, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> On Thu, Jul 13, 2006 at 01:41:44PM -0400, Kurt Devlin wrote:
>>    I have the the following on one of my pages:
>>
>>        :[[~Kurt Devlin]]:Lead for [[MyProjectA/]], [[MyProjectB/]]
>>
>>    This gives me the unexpected result of:
>>
>>        Lead for MyProjectA|Kurt Devlin]]:Lead for MyProjectA, MyProjectB
>>
>>    Removing the comma after "[[MyProjectA/]]" or substituting "Profiles/" for
>>    the "~" gives me what I would expect:
>>
>>        Kurt Devlin
>>                Lead for MyProjectA MyProjectBThis
>>
>>    looks like some weird regular expression parsing error, but I don't know
>>    if it is with the PmWiki core or with any custom markup that has been
>>    added on.
>
>I don't think it's the PmWiki core, as it appear to work fine on
>pmwiki.org:
>
>    http://www.pmwiki.org/wiki/Test/Weird
>
>So, I'd look to recipes and/or local customizations as the
>culprit.
>
>Pm
>
>
>
>_______________________________________________
>pmwiki-users mailing list
>pmwiki-users at pmichaud.com
>http://host.pmichaud.com/mailman/listinfo/pmwiki-users
>


-- 
JR
--
John Rankin







More information about the pmwiki-users mailing list