Permalink
Browse files

[lib/Text/Markdown.pm, t/text.t] Newlines at EOF

  • Loading branch information...
ennio
ennio committed Jun 9, 2014
1 parent 9b4b26b commit 7434418c8586408f578f0b7396416243557d4b63
Showing with 8 additions and 1 deletion.
  1. +1 −1 lib/Text/Markdown.pm
  2. +7 −0 t/text.t
View
@@ -144,7 +144,7 @@ sub extract_tspans($text) {
grammar Markdown {
token TOP {
- ^ <paragraph>* % [\n\n+] $
+ ^ <paragraph>* % [\n\n+] \n* $
{ make Document.new(:children($<paragraph>».ast)) }
}
View
@@ -14,6 +14,13 @@ use Text::Markdown;
is +$doc.children, 2, "The slide has two elements";
}
+{
+ my $doc = parse-markdown "One slide.\n\n\nTwo paragraphs and some blanks.\n\n\n\n";
+
+ is +$doc.children, 2, "input ending with newline chars";
+ is $doc.children[1].text, "Two paragraphs and some blanks.", "any number of blank lines between paragraphs";
+}
+
{
my $doc = parse-markdown "One slide with *italics* in it.";
my $para = $doc.children[0];

0 comments on commit 7434418

Please sign in to comment.