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
d29ff182
Commit
d29ff182
authored
Feb 06, 2014
by
Emanuil Rusev
Browse files
resolve #92
parent
95e9878f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Parsedown.php
View file @
d29ff182
...
...
@@ -1028,7 +1028,7 @@ class Parsedown
case
'`'
:
if
(
preg_match
(
'/^(`+)[ ]*(.+?)[ ]*\1(?!`)/'
,
$text
,
$matches
))
if
(
preg_match
(
'/^(`+)[ ]*(.+?)[ ]*
(?<!`)
\1(?!`)/'
,
$text
,
$matches
))
{
$element_text
=
$matches
[
2
];
$element_text
=
htmlspecialchars
(
$element_text
,
ENT_NOQUOTES
,
'UTF-8'
);
...
...
tests/data/code_span.html
View file @
d29ff182
...
...
@@ -2,4 +2,5 @@
<p><code>
this is also a codespan
</code>
trailing text
</p>
<p><code>
and look at this one!
</code></p>
<p>
single backtick in a code span:
<code>
`
</code></p>
<p>
backtick-delimited string in a code span:
<code>
`foo`
</code></p>
\ No newline at end of file
<p>
backtick-delimited string in a code span:
<code>
`foo`
</code></p>
<p><code>
sth `` sth
</code></p>
\ No newline at end of file
tests/data/code_span.md
View file @
d29ff182
...
...
@@ -6,4 +6,6 @@ a `code span`
single backtick in a code span:
`` ` ``
backtick-delimited string in a code span:
`` `foo` ``
\ No newline at end of file
backtick-delimited string in a code span:
`` `foo` ``
`sth `` sth`
\ 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