Disabling strike-through

131 views
Skip to first unread message

Morris Gray

unread,
Jan 12, 2008, 12:03:16 AM1/12/08
to TiddlyWiki
I am putting some vintage (18th century) writings into TiddlyWiki and
they make extensive use of the double-hyphen in the text. How can I
disable the strike-thru facility so their double-hyphens aren't seen
as code?

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners

wolfgang

unread,
Jan 26, 2008, 10:48:28 AM1/26/08
to TiddlyWiki
Good question Morris,

Maybe enclosing such text within <nowiki>...</nowiki> tags, would be a
solution?

Regards,

W.

On 12 Jan., 06:03, Morris Gray <msg...@symbex.net.au> wrote:
> I am putting some vintage (18th century) writings into TiddlyWiki and
> they make extensive use of the double-hyphen in the text. How can I
> disable the strike-thru facility so their double-hyphens aren't seen
> as code?
>
> Morris Grayhttp://twhelp.tiddlyspot.com

Simon Baird

unread,
Jan 31, 2008, 2:17:20 AM1/31/08
to Tiddl...@googlegroups.com
It should be reasonably easy to remove that wikifier.

This is untested but...

config.formatters.findByField('name','strikeByChar').match = 'NothingShouldMatchThisISayMwhuhuhahaaaa38383289293522352';

or maybe this:

config.formatters.remove(config.formatters.findByField('name','strikeByChar'));

--
simon...@gmail.com

Morris Gray

unread,
Feb 1, 2008, 10:29:17 PM2/1/08
to TiddlyWiki
On Jan 31, 6:17 pm, "Simon Baird" <simon.ba...@gmail.com> wrote:
> It should be reasonably easy to remove that wikifier.

I found this bit of code which seems to convert the double-hyphen into
an &mdash; which is what the original author intended.

(function() {
for (var i = 0; i < config.formatters.length; i++)
if (config.formatters[i].name == "strikeByChar")
break;
if (i < config.formatters.length)
config.formatters.splice(i,1);
})();

Morris Gray
http://twhelp.tiddlyspot.com
A TiddlyWiki help file for beginners

> simon.ba...@gmail.com

wolfgang

unread,
Feb 20, 2008, 5:42:05 AM2/20/08
to TiddlyWiki
Hi Morris,

this works nicely if the double-hypen is surrounded by empty spaces.
Is it possible to make this piece of code also work if the double-
hypen is found in the middle of some text, as I just encountered and
struggle with in an old dictionary?

thanks in advance,

W.

On 2 Feb., 04:29, Morris Gray <msg...@symbex.net.au> wrote:
> On Jan 31, 6:17 pm, "Simon Baird" <simon.ba...@gmail.com> wrote:
>
> > It should be reasonably easy to remove that wikifier.
>
> I found this bit of code which seems to convert the double-hyphen into
> an &mdash; which is what the original author intended.
>
> (function() {
> for (var i = 0; i < config.formatters.length; i++)
> if (config.formatters[i].name == "strikeByChar")
> break;
> if (i < config.formatters.length)
> config.formatters.splice(i,1);
>
> })();
>
> Morris Grayhttp://twhelp.tiddlyspot.com

FND

unread,
Feb 20, 2008, 5:49:32 AM2/20/08
to Tiddl...@googlegroups.com
> this works nicely if the double-hypen is surrounded by empty spaces.
> Is it possible to make this piece of code also work if the double-
> hypen is found in the middle of some text, as I just encountered and
> struggle with in an old dictionary?

I'm not sure I understand the problem.
The code Simon and Morris posted disables the "strikeByChar" formatter.
Can you show me an example where that doesn't work for you?


-- F.

wolfgang

unread,
Feb 20, 2008, 6:42:07 AM2/20/08
to TiddlyWiki
Thanks for the fast reply, for example such dictionary text:

A--3 [Vedic a--; Idg. *e (loc. of pron. stem, cp. ayaŋ; orig. a
deictic adv. with specific reference to the past, cp. Sk sma);

- if I place a space before and after the double-hypens it does
disable the strikeByChars. But not as it is direct next to other
letters.

Regards,

W.

FND

unread,
Feb 20, 2008, 6:50:42 PM2/20/08
to Tiddl...@googlegroups.com
> if I place a space before and after the double-hypens it does
> disable the strikeByChars. But not as it is direct next to other
> letters.

Actually, the strikeByChar formatter doesn't exist in recent TiddlyWiki
versions anymore. I believe it has been replaced by the characterFormat
formatter - changing that is more complicated though, as it would
require overriding the entire handler function.
I can't think of a good solution right now...


-- F.

wolfgang

unread,
Feb 21, 2008, 7:41:31 AM2/21/08
to TiddlyWiki
Thanks for letting me know. Will have to search/replace in this case.

regards,

W.

Martin Budden

unread,
Feb 21, 2008, 12:39:23 PM2/21/08
to Tiddl...@googlegroups.com
I've created a basic plugin to disable strikethrough for old and new
versions of tiddlywikis. It's at:

http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/plugins/DisableStrikeThroughPlugin.js

Martin

wolfgang

unread,
Feb 21, 2008, 1:47:49 PM2/21/08
to TiddlyWiki
Thanks for this plugin, Martin!

It works in my case - wasn't expecting such a fast solution :-)

Regards,

W.

On 21 Feb., 18:39, "Martin Budden" <mjbud...@gmail.com> wrote:
> I've created a basic plugin to disable strikethrough for old and new
> versions of tiddlywikis. It's at:
>
> http://svn.tiddlywiki.org/Trunk/contributors/MartinBudden/plugins/Dis...
>
> Martin
Reply all
Reply to author
Forward
0 new messages