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.

22 lines
367 B

  1. #!/usr/bin/env perl
  2. # un-htmlify certain things in old DigitalOcean tutorials
  3. # primitive af
  4. use strict;
  5. use warnings;
  6. use 5.10.0;
  7. my $text;
  8. {
  9. # line separator:
  10. local $/ = undef;
  11. $text = <>;
  12. }
  13. $text =~ s{<pre>(.*?)</pre>}{```$1```}gs;
  14. $text =~ s{<span class="highlight">(.*?)</span>}{<^>$1<^>}gs;
  15. $text =~ s{&gt;}{>}gs;
  16. $text =~ s{&lt;}{<}gs;
  17. print $text;