search for: _doitalicsandbold

Displaying 2 results from an estimated 2 matches for "_doitalicsandbold".

2009 Nov 04
2
A Suggestion for Strikethrough Syntax
...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; # <strong> must go first: $text =~ s{ (\*\*|__) (?=\S) (.+?[*_]*) (?<=\S) \1 } {<strong>$2</strong>}gsx; $text =~ s{ (\*|_) (?=\S) (.+?) (?<=\S) \1 } {<em>$2</em>}gsx; # These lines added by Bill Eccles,...
2007 Dec 08
2
Great work!
...dBold() it didn't work because of the /s that were already added as part of close-tags. So I decided to use |italic|, *bold*, ^superscript^, _subscript_, =underline=, ~strikethrough~, $big$ and %small% to go with `typewriter` (which seems to be done differently), implemented like this: sub _DoItalicsAndBold { my $text = shift; $text =~ s{ (\|) (?=\S) (.+?) (?<=\S) \1 } {<i>$2</i>}gsx; $text =~ s{ (\*) (?=\S) (.+?) (?<=\S) \1 } {<b>$2</b>}gsx; $text =~ s{ (\^) (?=\S) (.+?) (?<=\S) \1 } {<sup>$2</sup>}gsx; $text =~ s{ (_) (?=\S) (.+?) (?<=\S) \1 } {...