mirror of
https://github.com/erusev/parsedown.git
synced 2025-03-15 02:49:39 +01:00
resolve #21
This commit is contained in:
parent
cdb2646063
commit
b6f795962f
@ -769,7 +769,7 @@ class Parsedown
|
||||
if (strpos($text, '_') !== FALSE)
|
||||
{
|
||||
$text = preg_replace('/__(?=\S)(.+?)(?<=\S)__(?!_)/s', '<strong>$1</strong>', $text);
|
||||
$text = preg_replace('/_(?=\S)(.+?)(?<=\S)_/s', '<em>$1</em>', $text);
|
||||
$text = preg_replace('/\b_(?=\S)(.+?)(?<=\S)_\b/s', '<em>$1</em>', $text);
|
||||
}
|
||||
|
||||
if (strpos($text, '*') !== FALSE)
|
||||
|
@ -2,4 +2,5 @@
|
||||
<p><em>multiline
|
||||
emphasis</em></p>
|
||||
<p>_ this _ is not an emphasis, neither is _ this_, _this _, or _this*</p>
|
||||
<p>this_is_not_an_emphasis</p>
|
||||
<p>an empty emphasis __ ** is not an emphasis</p>
|
@ -5,4 +5,6 @@ emphasis_
|
||||
|
||||
_ this _ is not an emphasis, neither is _ this_, _this _, or _this*
|
||||
|
||||
this_is_not_an_emphasis
|
||||
|
||||
an empty emphasis __ ** is not an emphasis
|
Loading…
x
Reference in New Issue
Block a user