[pmwiki-users] Flagging Bare Wikiwords . . .

Patrick R. Michaud pmichaud at pobox.com
Mon Nov 21 09:40:19 CST 2005

On Mon, Nov 21, 2005 at 09:20:45AM -0600, Patrick R. Michaud wrote:
> On Sun, Nov 20, 2005 at 03:46:20PM -0600, Ben Wilson wrote:
> > I would ask one of two solutions. Either assign WikiLink() to a variable 
> > (e.g. $WikiLink) so we may override more painlessly, or sneak a span 
> > into WikiLink() as I have done that will allow me to flag the link.
> How about a third solution...?  In a local customization file:
>     Markup('wikilink', '>urllink',
>       "/\\b($GroupPattern([\\/.]))?($WikiWordPattern)/e",
>       "Keep('<span class=\\'missingLink\\'>$0</span>', 'L')");

Actually, a fourth solution, which I'm likely to adopt into the
core distribution, is:

     Markup('wikilink', '>urllink',
       "Keep('<span class=\\'wikiword\\'>'
          . WikiLink(\$pagename,'$0') . '</span>', 'L')");

Then wikiword links can be styled separately from other page links.
In particular, the following CSS settings can be made:

    span.wikiword a.createlink { display:none; }
    span.wikiword a.createlinktext { text-decoration:none; 
      border-bottom:none; color:inherit; }

which will cause WikiWord links to existing pages to continue to
display as links, while WikiWords to non-existent pages would display
as normal text (but would still be clickable links to create the page).

Additional CSS could be used to make WikiWord links to existing pages
stand out, while still remaining links:

    span.wikiword a.wikilink { background-color: pink; }


More information about the pmwiki-users mailing list