diff options
author | Jonas Smedegaard <dr@jones.dk> | 2015-01-26 18:13:55 +0100 |
---|---|---|
committer | Jonas Smedegaard <dr@jones.dk> | 2015-01-26 18:13:55 +0100 |
commit | aeb52d3cb260e0d2f228af1c804cd34e2f25c9cf (patch) | |
tree | e96f2c705587f34d063e6538ed92abbd0da80b40 /markdown-tidy | |
parent | aa152df7416fd66fc91f505648b16992f95438e8 (diff) |
Fix add markdown-tidy script.
Diffstat (limited to 'markdown-tidy')
-rwxr-xr-x | markdown-tidy | 21 |
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; |