Compare commits
2 Commits
11af6d0511
...
f6d87eb878
| Author | SHA1 | Date | |
|---|---|---|---|
| f6d87eb878 | |||
| b2969d8f47 |
@@ -10,6 +10,7 @@ my %CLOSING_TAGS = (
|
||||
olist => "</ol>",
|
||||
blockquote => "</blockquote>",
|
||||
table => "</table>",
|
||||
code_block => "</code></pre>",
|
||||
);
|
||||
|
||||
sub new {
|
||||
@@ -166,7 +167,6 @@ sub handle_code_block_line {
|
||||
my ( $self, $line ) = @_;
|
||||
|
||||
if ( $line =~ /^```/ ) {
|
||||
$self->{output} .= "</code></pre>\n";
|
||||
$self->transition_to_state('paragraph');
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 5;
|
||||
use Test::More tests => 6;
|
||||
use MarkdownParser;
|
||||
|
||||
my $parser = MarkdownParser->new();
|
||||
@@ -32,4 +32,8 @@ is(
|
||||
"<pre><code>\n</code></pre>\n",
|
||||
"Empty code block"
|
||||
);
|
||||
|
||||
is(
|
||||
$parser->parse("```\nunterminated"),
|
||||
"<pre><code>\nunterminated\n</code></pre>\n",
|
||||
"Unclosed code block is closed at EOF"
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user