[pmwiki-users] `WikiWord disables WikiWord ?

John Rankin john.rankin at affinity.co.nz
Thu Jul 28 21:33:33 CDT 2005


On Friday, 29 July 2005 1:57 PM, DaveG <pmwiki at solidgone.com> wrote:
> Patrick R. Michaud wrote:
>On Fri, Jul 29, 2005 at 09:33:17AM +1200, John Rankin wrote:
>  
>
>I hadn't looked at the definition of this particular rule until now, and
>I must say it's *very* nicely done.  I may adopt it for the distribution, 
>or at least put it in the sample-config.php file.  
>      
>
>Doing this will break a number of local customisations, which rely on
>knowing whether or not to treal abbreviations as wikiwords.
>    
> Local customizations, or cookbook/recipies? Sounds reasonable
>to suspend the proposed ` if a cookbook relies on it, but for a
>local customization, perhaps the trade off is worth it? For
>myself, the abbreviation issue is considerable, and not one
>easily dealt with using WikiWordCount.

The markup extensions recipe raises a flag if abbreviations are
treated as normal text. Other markup extensions plus the page
rename recipe act according to that flag. 

A solution that changes the wikiword pattern to require 2 or more
lower case characters will also work, shown below.
>
>
>Then it won't go into the distribution anytime soon.
>
>The other approach is to adjust the $WikiWordPattern to require at
>least two lowercase letters, but that has its own set of issues.
>At any rate, it won't happen anytime soon.
>  
> This is a reasonable interim solution. Could someone help me
>with an addition to include wikiwords with numbers -- thus MR2
>would be treated as an acronym and ignored as a wikiword?

The markup extensions recipe tested the following pattern, which
is currently disabled:

## require 2 lower and upper case characters for a WikiWord
$WikiWordPattern = '[[:upper:]][[:alnum:]]*(?:[[:upper:]][[:lower:]0-9][[:lower:]0-9]|[[:lower:]0-9][[:lower:]0-9][[:upper:]]|[[:lower:]0-9][[:upper:]]+[[:lower:]0-9])[[:alnum:]]*';

Yuck!!

A modified abbreviation pattern is:
SDV($AbbreviationPattern,
  "[[:upper:]]+(?:[[:upper:]][[:lower:]0-9]|[[:lower:]0-9][[:upper:]])[[:upper:]]*");
Markup("abbr",'<`wikiword',"/`?\\b($AbbreviationPattern)\\b/e","Keep('$1')");

Try that, which incorporates Patrick's suggested sequence change. 



-- 
JR
--
John Rankin






More information about the pmwiki-users mailing list