For TWClassic, I created http://www.TiddlyTools.com/#DisableWikiLinksPlugin, 
which offers several options to control which links should be automatic and 
which should not:
>
>
> [_] Disable ALL automatic WikiWord tiddler links
> [_] ... except for WikiWords contained in shadow tiddlers
> [x] Disable automatic WikiWord links for non-existing tiddlers
> [x] Disable automatic WikiWord links for words listed in: 
> [___DisableWikiLinksList___]
> [x] Disable automatic WikiWord links for tiddlers tagged with: 
> [___excludeWikiWords___]
>
> For my own purposes, I usually use the "disable links for non-existing 
> tiddlers" plus "disable links listed in a tiddler.  I feel this gives me 
> the best of both worlds: references to tiddlers that have CamelCase titles 
> are automatically linked, but other CamelCase usage is not linked until a 
> tiddler with that title actually exists, and any CamelCase tiddlers that I 
> don't want linked are explicitly listed (as plain text, one per line) in 
> DisableWikiLinksList.  The tagging option disables autolinking for each 
> tiddler that is so tagged, and is conceptually the same as adding "\rules 
> except wikilink" to each tiddler in TW5.
>

It's another of the features I used a lot when I was working with the 
classic version.

But as it turns out, Astrid had the right answer, I just did it in the 
wrong way. I didn't need to have something that modified the config type 
module; I needed to read the whitelist into the  
$:/core/modules/parsers/wikiparser/rules/wikilink.js 
<http://tw5editor.tiddlyspot.com/#%24%3A%2Fcore%2Fmodules%2Fparsers%2Fwikiparser%2Frules%2Fwikilink.js>
 
tiddler:


So now instead of reading like this:

// If the link is on the whitelist then just output it as plain text
> var dummy=$tw.config.whitelist.indexOf(linkText);
> if(dummy>-1) {
>    return [{type: "text", text: linkText}];
> }
>
>
the $:/core/modules/parsers/wikiparser/rules/wikilink.js tiddler reads like 
this:

// If the link is on the whitelist then just output is as plain text
> var dummy = "$:/sk/WhiteList"
> var whitelist=$tw.wiki.getTiddlerText(dummy).split(",");
> var n=whitelist.indexOf(linkText);
> if(n>-1) {
>
>  return [{type: "text", text: linkText}];
> }
>
>  
and the whitelist is tucked away in $:/sk/WhiteList.

Thanks Astrid.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/tiddlywikidev.
For more options, visit https://groups.google.com/d/optout.

Reply via email to