Dotfiles, utilities, and other apparatus.
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#!/usr/bin/env perl
|
|
|
|
# un-htmlify certain things in old DigitalOcean tutorials
|
|
# primitive af
|
|
|
|
use strict;
|
|
use warnings;
|
|
use 5.10.0;
|
|
|
|
my $text;
|
|
{
|
|
# line separator:
|
|
local $/ = undef;
|
|
$text = <>;
|
|
}
|
|
|
|
$text =~ s{<pre>(.*?)</pre>}{```$1```}gs;
|
|
$text =~ s{<span class="highlight">(.*?)</span>}{<^>$1<^>}gs;
|
|
$text =~ s{>}{>}gs;
|
|
$text =~ s{<}{<}gs;
|
|
|
|
print $text;
|