#!/bin/sh # Mangle the rendered files to cause fewer differences after re-rendering. # Written by Thomas Schwinge . # Un-mangle mailto links: convert HTML character entities to real characters. find ./ -name \*.html -print0 \ | xargs -0 --no-run-if-empty -n 1 \ perl -e \ 'BEGIN { $file = $ARGV[0]; $discard = 1; $replacing = 0; # TODO: could use a proper temporary file. open(OUT, ">$file.new") or die "open: $file: $!"; select(OUT) or die "select: $file: $!"; } while (<>) { # The replacing-toggling logic is a bit rough, but so is life. $replacing = 1 if /