1
0
mirror of https://github.com/erusev/parsedown.git synced 2023-08-10 21:13:06 +03:00
This commit is contained in:
Emanuil Rusev 2013-11-21 00:59:12 +02:00
parent cdb2646063
commit b6f795962f
3 changed files with 4 additions and 1 deletions

View File

@ -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)

View File

@ -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>

View File

@ -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