summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmarkdown-tidy21
1 files changed, 21 insertions, 0 deletions
diff --git a/markdown-tidy b/markdown-tidy
new file mode 100755
index 0000000..cba5b62
--- /dev/null
+++ b/markdown-tidy
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+# extract and decode markdown content from HTML source
+
+use warnings;
+use strict;
+
+use Path::Tiny;
+
+my $infile = shift;
+my $outfile = shift || $infile;
+
+$_ = path($infile)->slurp_utf8;
+
+s!.*?<div class=\"panel-heading\">!!s;
+s!</?div[^>]*>!!g;
+s!\S+png\S+!!g;
+
+path($outfile)->spew_utf8($_);
+
+1;