resolve #27
This commit is contained in:
parent
50a58eab16
commit
a4fb0651d5
|
@ -678,13 +678,13 @@ 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('/_(?=\S)(.+?)(?<=\S)_/s', '<em>$1</em>', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
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('/\*(?=\S)(.+?)(?<=\S)\*/s', '<em>$1</em>', $text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
<p><strong><em>em strong</em></strong></p>
|
||||||
|
<p><strong><em>one</em> at the start</strong></p>
|
||||||
|
<p><strong>one at the <em>end</em></strong></p>
|
||||||
|
<p><strong>one <em>in the</em> middle</strong></p>
|
||||||
|
<p><strong>one with <em>asterisks</em></strong></p>
|
|
@ -0,0 +1,9 @@
|
||||||
|
___em strong___
|
||||||
|
|
||||||
|
___one_ at the start__
|
||||||
|
|
||||||
|
__one at the _end___
|
||||||
|
|
||||||
|
__one _in the_ middle__
|
||||||
|
|
||||||
|
**one with *asterisks***
|
Loading…
Reference in New Issue