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
7249d02c
Commit
7249d02c
authored
Nov 05, 2013
by
Emanuil Rusev
Browse files
code blocks get unwanted empty lines
parent
ecf86b07
Changes
3
Hide whitespace changes
Inline
Side-by-side
Parsedown.php
View file @
7249d02c
...
...
@@ -216,7 +216,12 @@ class Parsedown
{
if
(
$element
[
'type'
]
===
'code'
)
{
isset
(
$element
[
'interrupted'
])
and
$element
[
'text'
]
.
=
"
\n
"
;
if
(
isset
(
$element
[
'interrupted'
]))
{
$element
[
'text'
]
.
=
"
\n
"
;
unset
(
$element
[
'interrupted'
]);
}
$element
[
'text'
]
.
=
"
\n
"
.
$matches
[
1
];
}
...
...
tests/data/code_block.html
View file @
7249d02c
<p>
Here's a regular code block:
</p>
<pre><code>
<
?php
echo 'Hello World!';
?
>
</code></pre>
<p>
Here's one that holds a list:
</p>
<pre><code>
- list item
<p>
Here's a code block:
</p>
<pre><code>
<
?php
$message = 'Hello World!';
echo $message;
</code></pre>
<p>
Here's one that holds a list:
</p>
<pre><code>
- list item
- another list item
</code></pre>
\ No newline at end of file
tests/data/code_block.md
View file @
7249d02c
Here's a regular code block:
<?php
echo 'Hello World!';
?>
Here's one that holds a list:
- list item
- another list item
Here's a code block:
<?php
$message = 'Hello World!';
echo $message;
Here's one that holds a list:
-
list item
-
another list item
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