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
2da10d27
Commit
2da10d27
authored
May 14, 2014
by
Emanuil Rusev
Browse files
resolve #105
parent
532b5ede
Changes
3
Hide whitespace changes
Inline
Side-by-side
Parsedown.php
View file @
2da10d27
...
...
@@ -87,7 +87,7 @@ class Parsedown
'8'
=>
array
(
'List'
),
'9'
=>
array
(
'List'
),
':'
=>
array
(
'Table'
),
'<'
=>
array
(
'Markup'
),
'<'
=>
array
(
'Comment'
,
'Markup'
),
'='
=>
array
(
'Setext'
),
'>'
=>
array
(
'Quote'
),
'_'
=>
array
(
'Rule'
),
...
...
@@ -346,6 +346,43 @@ class Parsedown
return
$Block
;
}
#
# Comment
protected
function
identifyComment
(
$Line
)
{
if
(
isset
(
$Line
[
'text'
][
3
])
and
$Line
[
'text'
][
3
]
===
'-'
and
$Line
[
'text'
][
2
]
===
'-'
and
$Line
[
'text'
][
1
]
===
'!'
)
{
$Block
=
array
(
'element'
=>
$Line
[
'body'
],
);
if
(
preg_match
(
'/-->$/'
,
$Line
[
'text'
]))
{
$Block
[
'closed'
]
=
true
;
}
return
$Block
;
}
}
protected
function
addToComment
(
$Line
,
array
$Block
)
{
if
(
isset
(
$Block
[
'closed'
]))
{
return
;
}
$Block
[
'element'
]
.
=
"
\n
"
.
$Line
[
'body'
];
if
(
preg_match
(
'/-->$/'
,
$Line
[
'text'
]))
{
$Block
[
'closed'
]
=
true
;
}
return
$Block
;
}
#
# Fenced Code
...
...
test/data/HTML_Comment.html
0 → 100644
View file @
2da10d27
<!-- single line -->
<p>
paragraph
</p>
<!--
multiline -->
<p>
paragraph
</p>
\ No newline at end of file
test/data/HTML_Comment.md
0 → 100644
View file @
2da10d27
<!-- single line -->
paragraph
<!--
multiline -->
paragraph
\ 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