[pmwiki-users] Wikiwords and style identifiers bug and workaround

Pico pmwiki at ben-amotz.com
Wed Aug 9 00:19:18 CDT 2006

John Rankin wrote:
> On Wednesday, 9 August 2006 1:43 PM, Pico <pmwiki at ben-amotz.com> wrote:
>> Dominique Faure wrote:
>>> Hi,
>>> Developing a new cookbook recipe involving divs, my kindly beta-tester
>>> found that using a Wikiword as a style identifier breaks the page
>>> output.
>>> An example is available at http://www.pmwiki.org/wiki/Test/WikiWordsAndStyles
>>> The reason is that during the page markup translation, links/wikiwords
>>> are handled before blocks/styles, so such identifier is recognized and
>>> interpreted as a wikiword wherever it could occur in the page.
>>> A workaround could be to introduce non wikiword chars allowed in
>>> identifiers (underscores,...) or even use the fact that forbidden
>>> chars in identifiers are replaced by underscore:
>>> (:div id='an identifier with forbidden chars':)
>>> ...
>>> In the markup above, the identifier is rendered as:
>>> <div id='an_identifier_with_forbidden_chars'>
>>> ...
>> Yeah, I noticed this when I was testing the ShowHide recipe back in 
>> March and noted the following workarounds:
>> "Naming a div id. Watch out for Uppercase characters. If your first 
>> character is uppercase, then all the rest must be in lowercase (Abc). 
>> Additional capitals (ABc and AbC) will cause the markup to fail. If your 
>> first character is lowercase, however, then you can have multiple 
>> uppercase characters (aBC). --Pico"
>> Pico
> What happens if you "escape" the wikiword?
>>> id='`MyDiv'<<
> Fromm memory, the `MyDiv will be put in a Keep and restored in time
> for style processing.

It breaks every way that I have tested it:

I'm not sure how it works.  But I thought that "escaping" a WikiWord 
with a grave (or backtick) simply neutralized the interpretation of a 
recognized WikiWord as a link.  That may have no effect on the separate 
step of recognizing a string as a WikiWord based on $WikiWordPattern. 
For example, while the default configuration has all WikiWords disabled 
as links, the underlying $WikiWordPatterns are still evaluated in 
rendering the special definitional links provided by vardoc.php


More information about the pmwiki-users mailing list