From 8e2b89704b1aa436e206f04fac74027d8b0d8b20 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Sat, 7 Jan 2017 15:53:39 -0800 Subject: [PATCH] Markdown.pl: process all file arguments The Markdown function can be called repeatedly, so stop ignoring file arguments after the first one and process them all just like the docs claim. Signed-off-by: Kyle J. McKay --- Markdown.pl | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Markdown.pl b/Markdown.pl index 35a206d..d17552a 100755 --- a/Markdown.pl +++ b/Markdown.pl @@ -248,12 +248,16 @@ elsif (!caller) { #### Process incoming text: ########################### - my $text; - { - local $/; # Slurp the whole file - $text = <>; + for (;;) { + local $_; + { + local $/; # Slurp the whole file + $_ = <>; + } + defined($_) or last; + print Markdown($_, \%options); } - print Markdown($text, \%options); + exit 0; } }