blob: 5b483e31d743d145c3e2ccd055c53fe10436b804 (
plain)
- #!/usr/bin/perl
- # extract and decode mediawiki content from HTML source view
- use warnings;
- use strict;
- use Path::Tiny;
- use HTML::HTML5::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;
|