Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
CentralNic
parsedown
Commits
a4fb0651
Commit
a4fb0651
authored
Nov 13, 2013
by
Emanuil Rusev
Browse files
resolve #27
parent
50a58eab
Changes
3
Hide whitespace changes
Inline
Side-by-side
Parsedown.php
View file @
a4fb0651
...
...
@@ -678,13 +678,13 @@ class Parsedown
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
);
}
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
);
}
...
...
tests/data/emphasis_-_em_strong.html
0 → 100644
View file @
a4fb0651
<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>
\ No newline at end of file
tests/data/emphasis_-_em_strong.md
0 → 100644
View file @
a4fb0651
___em strong__
_
___one_ at the start__
__one at the _end__
_
__one _in the_ middle__
**one with *asterisks**
*
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment