summaryrefslogtreecommitdiff
path: root/markdown-tidy
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-01-26 18:13:55 +0100
committerJonas Smedegaard <dr@jones.dk>2015-01-26 18:13:55 +0100
commitaeb52d3cb260e0d2f228af1c804cd34e2f25c9cf (patch)
treee96f2c705587f34d063e6538ed92abbd0da80b40 /markdown-tidy
parentaa152df7416fd66fc91f505648b16992f95438e8 (diff)
Fix add markdown-tidy script.
Diffstat (limited to 'markdown-tidy')
-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;