Browse Source

Markdown.pl: output deterministic documents

Obscuring email addresses is all very nice, but
outputting a different document every time for the
same input is not.

It screws up caching and last modified checks and
is a very bad thing to do.

Instead continue to obscure email addresses, but
arrange for the same obscurity to be used when the
same input file is processed repeatedly by Markdown.pl
on the same machine.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
master
Kyle J. McKay 7 years ago
parent
commit
189e87ac75
  1. 4
      Markdown.pl

4
Markdown.pl

@ -29,7 +29,7 @@ All rights reserved.
close(DATA) if fileno(DATA);
require Exporter;
use Digest::MD5 qw(md5_hex);
use Digest::MD5 qw(md5 md5_hex);
use File::Basename qw(basename);
use Pod::Usage;
@ISA = qw(Exporter);
@ -1336,7 +1336,7 @@ sub _EncodeEmailAddress {
$prefix = "" unless defined($prefix);
$suffix = "" unless defined($suffix);
srand;
srand(unpack('N',md5($addr)));
my @encode = (
sub { '&#' . ord(shift) . ';' },
sub { '&#x' . sprintf( "%X", ord(shift) ) . ';' },

Loading…
Cancel
Save