[pmwiki-users] Wikiwords and style identifiers bug and workaround
john.rankin at affinity.co.nz
Wed Aug 9 18:02:00 CDT 2006
On Thursday, 10 August 2006 4:18 AM, Patrick R. Michaud <pmichaud at pobox.com> wrote:
>On Wed, Aug 09, 2006 at 01:19:18AM -0400, Pico wrote:
>> John Rankin wrote:
>> > On Wednesday, 9 August 2006 1:43 PM, Pico <pmwiki at ben-amotz.com> wrote:
>> >> Dominique Faure wrote:
>> >>> Developing a new cookbook recipe involving divs, my kindly beta-tester
>> >>> found that using a Wikiword as a style identifier breaks the page
>> >>> output.
>Yes, this is arguably a bug. I don't have a simple fix at the moment.
>One possibility would be to say that '=' (for ids) and '#' (for colors)
>prevent the following sequence of characters from being treated as
>> > 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.
>The ` does escape the wikiword, but unfortunately the escape characters
>embedded in the string prevent the id from being recognized as a valid
I think I have another possible solution.
First, in the above examples, it has to be MyDiv as Mydiv is not a
wikiword, so ` has no effect.
Second, >>`MyDiv<< indeed does not work as one might have expected,
producing %div MyDiv apply=div%
However, the markup extensions recipe lets you escape a wikiword in
the middle: >>My`Div<< simply removes the ` after link processing,
so style processing then "just works". The above produces
<div class='MyDiv' >, which is correct.
>Which leaves us with the bug. I'm still thinking that perhaps the
>best solution would be to say that a wikiword cannot immediately
>follow a '#' or '=' (and perhaps ':' as well).
Do you mean "and perhaps ';' as well"? Presumably, the following
should be valid: >>MyDiv<<, which will be >>MyDiv<<.
I don't really understand why the >>`MyDiv<< trick doesn't work.
The >>...<< markup is clearly being translated correctly and
according to wikistyles.php, it will "restore links before
applying styles". So by the time it reaches wikistyles, the
above should read %div MyDiv apply=div% and it should work as
expected. Clearly I am missing something obvious.
So in my view, the bug is that >>`MyDiv<< doesn't work the way
one might reasonably expect from the specification of `WikiWord
More information about the pmwiki-users