I'm a *nix jibbler so I often note down commands which involve -- (for
example: emerge --sync ). The problem I'm having is that this is being
picked up as "start strikethrough". Is there a method of escaping
formatting, or specifically escaping the strikethrough -- code?
Thanks in advance
Allen
To enable the porn finder, type {{{sudo rm -Rf / }}}
..and it'll stop any formatting weirdness like strikethrough. I
think.. sorry, I'm too lazy to test it :)
Cheers
;Daniel
--
Daniel Baird
http://tiddlyspot.com (free, effortless TiddlyWiki hosting)
http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog ::
Things That Suck)
Allen
> Daniel Bairdhttp://tiddlyspot.com(free, effortless TiddlyWiki hosting)http://danielbaird.com(TiddlyW;nks! :: Whiteboard Koala :: Blog ::
> Things That Suck)
You can use a plugin to get rid of formatters you don't need or want.
For example, created a new Tiddler, name it anything you want (like
NoStrikethroughPlugin, for example) and tag it as systemConfig. Then
copy the following into the tiddler:
/***
Plugin which gets rid of strikethrough formatting.
***/
//{{{
for (var i = 0; i < config.formatters.length;i++)
{
if (config.formatters[i].name == "strikeByChar")
{
config.formatters.splice(i, 1);
break;
}
}
//}}}
Be sure and save the tiddler and save changes to the TiddlyWiki. But,
basically, that gets rid of --strikethrough-- type formatting. If you
want strikethrough text, add the following to the StyleSheet tiddler:
.strikethrough
{
text-decoration: line-through;
}
And then you can use {{strikethrough{text}}} to format strikethrough
text. Of course, you can call the CSS class something shorter (like
stt) for less typing.
Anyway, from your posts, I kind of got the impression that using
strikethrough text is the exception for you. If that's the case, then
this solution may work. Good luck!
Personally I like --- since it doesn't conflict with anything. ==
conflicts with C/javascript equality and so does ===.
Justin Case [bla...@gmail.com] wrote:
> .strikethrough
> {
> text-decoration: line-through;
> }
>
> And then you can use {{strikethrough{text}}} to format strikethrough
> text. Of course, you can call the CSS class something shorter (like
> stt) for less typing.
--
Cheers,
Bob McElrath [Univ. of California at Davis, Department of Physics]
A people that values its privileges above its principles soon loses both.
- Dwight Eisenhower
The code for that plugin could be something like:
for (var i = 0; i < config.formatters.length;i++)
{
if (config.formatters[i].name == "mdash")
{
config.formatters[i].match = "\\\\-\\\\-";
break;
}
}
Since your original post wanted escaping... this would fix it such that
--text would display as --text (no mdash) but \-\-text would display as
an mdash.
Please ignore that first message. Sorry.
--- for strikethrough? I like it... that plugin would be something
like:
for (var i = 0; i < config.formatters.length;i++)
{
if (config.formatters[i].name == "strikeByChar")
{
config.formatters[i].match = "---(?!\\s|$)";
config.formatters[i].termRegExp = /((?!\s)---|(?=\n\n))/mg;
break;
}
}
Very nice -- great idea -- thanks!
MediaWiki has a convenient thing where any lines that start with
whitespace gets wrapped in a pre tag.. something like that would be
cool maybe?
;D
--
Daniel Baird
http://tiddlyspot.com (free, effortless TiddlyWiki hosting)
http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog ::
Things That Suck)
I'm sorry but all of the plugin suggestions, so far, have not done
this. Rather, they either remove completely or change the way existing
formatters work.
To do what you suggest, above, create a new tiddler, name it anything
(say EscapeDoubleDashPlugin), give it the systemConfig tag, and then
paste this into the tiddler:
/***
This plugin escapes the double dash.
!!!Examples
|!Wiki Text|!Formatted|
|{{{gzip \-\-help}}}|gzip \-\-help|
|{{{c\-\-;}}}|c\-\-;|
|{{{\-\-text\-\-}}}|\-\-text\-\-|
!!!Code
***/
//{{{
config.formatters.push({
name: "EscapeDoubleDash",
match: "\\\\-\\\\-",
handler: function(w)
{
createTiddlyElement(w.output,"span").innerHTML = "--";
}
});
//}}}
Save the tiddler (done) and then save changes to the TiddlyWiki. On
reload, the examples actually work.
Obviously, you DO NOT want to use this plugin with the "mdash" code I
posted earlier (as they match on the exact same escape sequence (\-\-).
Also, none of the other posted plugin code needs to go in. This will
work, as is -- all by itself and just like you originally asked for.
Cool -- you bet! Try this one out:
/***
Displays lines that begin with a space in a <pre> element.
!!!Example:
This displays in a <pre>.
--text--
c--
gzip --help
''bold''
//italics//
!!!Code
***/
//{{{
if(!version.extensions.PreSpacePlugin)
{
version.extensions.PreSpacePlugin = true;
config.formatters.push({
name: "PreSpace",
match: "^ ",
lookaheadRegExp: /((?:^ [^\n]*\n)+?)(^$\n?)/mg,
element: "pre",
handler: config.formatterHelpers.enclosedTextHelper
});
}
//}}}