From Bill.lists at Eccles.net Wed Nov 4 18:06:19 2009 From: Bill.lists at Eccles.net (Bill Eccles) Date: Wed, 4 Nov 2009 18:06:19 -0500 Subject: A Suggestion for Strikethrough Syntax Message-ID: <81A1E838-5304-45B4-9075-D428551419AC@Eccles.net> All, Hopefully, I'm not covering old territory, and a search of the list archives seems to indicate that I'm not. If I am, then I extend my apologies in advance. I use strikethrough a lot so I modify my Movable Type Markdown module as shown below, right about line 1040 or so. I assume other Markdown implementations can use this change as well: sub _DoItalicsAndBold { my $text = shift; # must go first: $text =~ s{ (\*\*|__) (?=\S) (.+?[*_]*) (?<=\S) \1 } {$2}gsx; $text =~ s{ (\*|_) (?=\S) (.+?) (?<=\S) \1 } {$2}gsx; # These lines added by Bill Eccles, 2008-07-04 $text =~ s{ (\s) (-) (?=\S) (.+?) (?<=\S) (-) } {$1$3}gsx; return $text; } It converts -text to be struck through- to text to be struck through. Simple, and it works for me. (I detail it at .) Thoughts? /Bill -------------- next part -------------- An HTML attachment was scrubbed... URL: From jgm at berkeley.edu Thu Nov 5 13:05:39 2009 From: jgm at berkeley.edu (John MacFarlane) Date: Thu, 5 Nov 2009 10:05:39 -0800 Subject: A Suggestion for Strikethrough Syntax In-Reply-To: <81A1E838-5304-45B4-9075-D428551419AC@Eccles.net> References: <81A1E838-5304-45B4-9075-D428551419AC@Eccles.net> Message-ID: <20091105180539.GA3196@protagoras.phil.berkeley.edu> +++ Bill Eccles [Nov 04 09 18:06 ]: > All, > > Hopefully, I'm not covering old territory, and a search of the list > archives seems to indicate that I'm not. If I am, then I extend my > apologies in advance. > > It converts > > -text to be struck through- > > to > > text to be struck through. > > Simple, and it works for me. Pandoc uses this syntax in its markdown extensions: ~~text to be struck through~~ http://johnmacfarlane.net/pandoc/README.html#strikeout One advantage of this over your proposal is that it doesn't require a leading space, which is useful for edits and occasionally other things (e.g. when you want to strike out the first word of a text): apol~~l~~ogies syntactic~~al~~ ~~Dear Colleagues:~~To whom it may concern: It also allows e.g. hyphenated words in struck-through text: ~~permutation-invariant~~ Now that it's been in pandoc for a while, I'd be reluctant to change this syntax, but it now strikes me that something like the following would look better: apol(~l~)ogies syntactic(~al~) (~permutation-invariant~) John From Bill.lists at Eccles.net Mon Nov 9 18:55:35 2009 From: Bill.lists at Eccles.net (Bill Eccles) Date: Mon, 9 Nov 2009 18:55:35 -0500 Subject: A Suggestion for Strikethrough Syntax In-Reply-To: References: Message-ID: <539EBA5E-6680-4DEA-B3C4-4D400A8E693B@Eccles.net> > Pandoc uses this syntax in its markdown extensions: > > ~~text to be struck through~~ 8< snip! > > Now that it's been in pandoc for a while, I'd be reluctant > to change this syntax, but it now strikes me that something > like the following would look better: > > apol(~l~)ogies > syntactic(~al~) > (~permutation-invariant~) > > John Actually, I like your double-tilde notation a lot better than my hyphen notation. It accomplishes much better what John set out to do, namely make something that looks like what it represents. And a tilde does look a lot like a scribble, which is a lot like what a strikethrough represents. I don't much care for the parenthesis-laden notation, though. Doesn't quite look like what it represents as much as the double-tilde does. I'd love to see Pandoc integrated with Movable Type. That'd be sweeeeeeet. /Bill