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