[pmwiki-users] ExtendedMarkup WikiWord Error

John Rankin john.rankin at affinity.co.nz
Wed Mar 30 17:35:16 CST 2005


On Thursday, 31 March 2005 10:05 AM, Stan Ritchie <stan at ritchietribe.net> wrote:
> Hi Guys,
>
> Thanks for you help on this one.  I made the change Paul
>indicates by adding the /s.  This does eliminate the error and
>I can create pages, but the wikilink has many double quotes
>added to it like:
>
><61;60;61;60;61;60;61;60;56;60;61;60;61;60;61;60;61;60;61;60;61;60;61;57;61;60;61;60;61;60;61;60;56;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;57;61;Stan<61;60;61;60;61;60;61;60;56;60;61;60;61;60;61;60;61;60;61;57;61;60;61;60;61;60;61;57;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;61;60;56;60;?
>
> Any ideas?

Nope! I had tried the /s option and can report that I got the 
same result as you. At that point I gave up -- it's probably
something blindingly obvious, but I have not been able to
spot it.
>
> Again, thanks for the prompt response and help.  I've been
>working with PmWiki for about a month and am having a blast!
>
> You guys are doing a great job with this stuff!
>
> Stan
>
>
> Patrick R. Michaud wrote:
>On Thu, Mar 31, 2005 at 09:28:22AM +1200, John Rankin wrote:
>  
>
>This is a known limitation in how ExtendMarkup handles smart
>quotes.
>
>In short, if an html tag < ... > breaks across more than 2 lines,
>the piece of code that ignores quotes inside < ... > breaks.
>    
>
>
>Oh!  Did you try adding the /s option to the relevant patterns?
>I'm guessing that the code to handle this is given in:
>
>    ## automatic smart quotes
>    Markup('<n>','<squo',"/\s?\n\s*([^<]+?>)/",' $1');
>    Markup('squo','>style',"/(<.*?>['\"]*)|(.?['\"]+)/e",
>        "BypassHTML(PSS('$1'),PSS('$2'))");
>    Markup('sq|','>inline',"/(\\[\\[[^|\\]]+\\|)(.*?)(\\]\\])/e",
>      "'$1'.SmartenLinkText(PSS('$2')).'$3'");
>    Markup('sq->','>inline',"/(\\[\\[)([^\\]]+?)(-+&gt;.*?\\]\\])/e",
>      "'$1'.SmartenLinkText(PSS('$2')).'$3'");
>
>By default the '.' in a pattern doesn't match newlines, but adding
>the 's' option, as in 
>
>    ## automatic smart quotes
>    Markup('<n>','<squo',"/\s?\n\s*([^<]+?>)/",' $1');
>    Markup('squo','>style',"/(<.*?>['\"]*)|(.?['\"]+)/es",
>        "BypassHTML(PSS('$1'),PSS('$2'))");
>    Markup('sq|','>inline',"/(\\[\\[[^|\\]]+\\|)(.*?)(\\]\\])/es",
>      "'$1'.SmartenLinkText(PSS('$2')).'$3'");
>    Markup('sq->','>inline',"/(\\[\\[)([^\\]]+?)(-+&gt;.*?\\]\\])/es",
>      "'$1'.SmartenLinkText(PSS('$2')).'$3'");
>
>will tell those .*?'s that they can match newlines as well.  There
>may be other reasons why it's not working (or won't work), but this
>is my first guess/thought about it.
>
>Or, one could conceivably convert any newlines found inside 
>< ... > into spaces before doing the rest of the pattern matches.  But
>the /s solution above is probably vastly superior and faster.
>
>Pm
>
>
>
>  
>


-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list