blob: c2dae689aea94c408cdd23e0e419adeddef2af10 (
plain)
- #!/usr/bin/perl
- # extract and decode mediawiki content from HTML source view
- use warnings;
- use strict;
- use Path::Tiny;
- use HTML::Entities;
- my $infile = shift;
- my $outfile = shift || $infile;
- $_ = path($infile)->slurp_utf8;
- s!.*<textarea[^>]*>!!s;
- s!</textarea.*!!s;
- decode_entities($_);
- path($outfile)->spew_utf8($_);
- 1;
|