diff options
author | Gervase Markham <gerv@mozilla.org> | 2017-02-26 03:54:49 +0100 |
---|---|---|
committer | Dylan William Hardison <dylan@hardison.net> | 2017-02-26 04:14:56 +0100 |
commit | d045206593953ebfeb22858baa25e8c2fe565e33 (patch) | |
tree | e728b094024a8cba884b22db30e45d037a8b03b7 /Bugzilla | |
parent | 4480c8ca91365aa60c60f371a6cc2fd3f22a1ff1 (diff) | |
download | bugzilla-d045206593953ebfeb22858baa25e8c2fe565e33.tar.gz bugzilla-d045206593953ebfeb22858baa25e8c2fe565e33.tar.xz |
Bug 1174341 - only treat emphasis markdown based on spaces
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Markdown.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Bugzilla/Markdown.pm b/Bugzilla/Markdown.pm index 72e788fd0..b7d7b4393 100644 --- a/Bugzilla/Markdown.pm +++ b/Bugzilla/Markdown.pm @@ -350,38 +350,38 @@ sub _DoItalicsAndBold { $text =~ s{ ^\* (?=\S) (.+?) (?<=\S) \* }{<em>$1</em>}gsx; # <strong> must go first: - $text =~ s{ ( (?<=\W) __ (?=\S) (.+?[*_]*) (?<=\S) __ (?!\S) ) } + $text =~ s{ ( (?<=\s) __ (?=\S) (.+?[*_]*) (?<=\S) __ (?!\S) ) } { my $result = _has_multiple_underscores($2) ? $1 : "<strong>$2</strong>"; $result; }gsxe; - $text =~ s{ (?<=\W) \*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* }{<strong>$1</strong>}gsx; + $text =~ s{ (?<=\s) \*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* }{<strong>$1</strong>}gsx; - $text =~ s{ ( (?<=\W) _ (?=\S) (.+?) (?<=\S) _ (?!\S) ) } + $text =~ s{ ( (?<=\s) _ (?=\S) (.+?) (?<=\S) _ (?!\S) ) } { my $result = _has_multiple_underscores($2) ? $1 : "<em>$2</em>"; $result; }gsxe; - $text =~ s{ (?<=\W) \* (?=\S) (.+?) (?<=\S) \* }{<em>$1</em>}gsx; + $text =~ s{ (?<=\s) \* (?=\S) (.+?) (?<=\S) \* }{<em>$1</em>}gsx; # And now, a second pass to catch nested strong and emphasis special cases - $text =~ s{ ( (?<=\W) __ (?=\S) (.+?[*_]*) (?<=\S) __ (\S*) ) } + $text =~ s{ ( (?<=\s) __ (?=\S) (.+?[*_]*) (?<=\S) __ (\S*) ) } { my $result = _has_multiple_underscores($3) ? $1 : "<strong>$2</strong>$3"; $result; }gsxe; - $text =~ s{ (?<=\W) \*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* }{<strong>$1</strong>}gsx; - $text =~ s{ ( (?<=\W) _ (?=\S) (.+?) (?<=\S) _ (\S*) ) } + $text =~ s{ (?<=\s) \*\* (?=\S) (.+?[*_]*) (?<=\S) \*\* }{<strong>$1</strong>}gsx; + $text =~ s{ ( (?<=\s) _ (?=\S) (.+?) (?<=\S) _ (\S*) ) } { my $result = _has_multiple_underscores($3) ? $1 : "<em>$2</em>$3"; $result; }gsxe; - $text =~ s{ (?<=\W) \* (?=\S) (.+?) (?<=\S) \* }{<em>$1</em>}gsx; + $text =~ s{ (?<=\s) \* (?=\S) (.+?) (?<=\S) \* }{<em>$1</em>}gsx; return $text; } |