diff --git a/Markdown.pl b/Markdown.pl index 17ffce5..6e00d2c 100755 --- a/Markdown.pl +++ b/Markdown.pl @@ -1048,11 +1048,15 @@ sub _DoItalicsAndBold { my $text = shift; # must go first: - $text =~ s{ (\*\*|__) (?=\S) (.+?[*_]*) (?<=\S) \1 } - {$2}gsx; - - $text =~ s{ (\*|_) (?=\S) (.+?) (?<=\S) \1 } - {$2}gsx; + $text =~ s{ \*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* } + {$1}gsx; + $text =~ s{ (?$1}gsx; + + $text =~ s{ \* (?=\S) (.+?) (?<=\S) \* } + {$1}gsx; + $text =~ s{ (?$1}gsx; return $text; } diff --git a/syntax.text b/syntax.text index d23a051..61a3885 100644 --- a/syntax.text +++ b/syntax.text @@ -740,8 +740,9 @@ will produce: You can use whichever style you prefer; the lone restriction is that the same character must be used to open and close an emphasis span. +Additionally `_` and double `_` are not recognized within words. -Emphasis can be used in the middle of a word: +Emphasis using `*` can be used in the middle of a word: un*frigging*believable