Here's why: if, when subwikifying the text between the starting and
terminating double underscores, a match for a WikiWord is found, then
the terminating underscores are eaten by the "wikiLink" matcher and so
are never received by the "underlineByChar" matcher.
The text __Wiki__Word__ makes this more obvious than the text __DOS__.
1) The easiest way to fix this is to remove the underscore from
config.textPrimitives.lowerLetter and config.textPrimitives.anyLetter.
This will have the effect that words containing underscores will not be
matched as WikiLinks. I think this is acceptable because:
a) CamelCase and words_separated_by_underscores are generally used as
alternatives, not together.
b) I know of at least one other Wiki (TWiki) that has the same
behavior.
c) If a user really wants a WikiLink with underscores, they can use the
[[..]] notation
d) I think that TiddlyWikis rarely use underscores in WikiLinks (I
don't recall seeing any) so very few users will be affected.
e) alternate fixes are problematic.
So what are the alternative fixes. Two come to mind
2) Setting a flag in the "underlineByChar" matcher and checking the
value of that flag in the "wikiLink" matcher. This is just horrible.
3) Using a character other than underscore for the "underlineByChar"
matcher. This is a bigger compatibility break than (1).
There's a bug ticket for this here:
http://trac.tiddlywiki.org/tiddlywiki/ticket/13
Cheers
Jeremy
--
Jeremy Ruston
mailto:jer...@osmosoft.com
http://www.tiddlywiki.com