summaryrefslogtreecommitdiff
path: root/bin/hedgedoc2quarto
diff options
context:
space:
mode:
Diffstat (limited to 'bin/hedgedoc2quarto')
-rwxr-xr-xbin/hedgedoc2quarto5
1 files changed, 3 insertions, 2 deletions
diff --git a/bin/hedgedoc2quarto b/bin/hedgedoc2quarto
index 23832ea..d2aacda 100755
--- a/bin/hedgedoc2quarto
+++ b/bin/hedgedoc2quarto
@@ -1,4 +1,4 @@
-#!/usr/bin/perl -g
+#!/usr/bin/perl
use v5.36;
use strict;
@@ -30,10 +30,11 @@ and they support different subsets of Mermaid diagram code.
=cut
+# slurp INFILE if passed as first argument, or else STDIN
my ( $infile, $outfile, $bogus ) = @ARGV;
die 'Too many arguments: expected INFILE and OUTFILE' if $bogus;
@ARGV = ($infile) if $infile;
-my $content = <>;
+my $content = do { local $/ = undef; <> };
$content
=~ s/^(?'fence'[``~]{3,})\s*\Kmermaid\n(?'type'gantt)\n(?'code'.*?\n)\k'fence'$/