[Blosxom-users] Blosxom + Markdown problem: randomised email links break RSS, Atom

Michel Fortin michel.fortin at michelf.com
Fri Jun 15 08:52:15 EDT 2007

Le 2007-06-15 à 3:44, Ron Hale-Evans a écrit :

> If no one wants to fix (or "fix") it, it should at least be

> documented. I am a technical writer by trade and will be happy to

> document the problem if someone will point me to the documentation

> leads for both projects.

I think the fix is easy: make the "random" encoding deterministic.
I've done it for PHP Markdown recently by adding a custom pseudo-
random generator to replace the standard random function used by the
algorithm. The new generator is seeded with a checksum of the email
address; this makes it deterministic.

If someone wants to port that change to Perl, I'll be glad to help.
Here are the relevant two lines of code from the `encodeEmailAddress`
function of PHP Markdown:

# Deterministic seed.
$seed = (int)abs(crc32($addr) / strlen($addr));

# Pseudo-random function.
$r = ($seed * (1 + $key)) % 100;

(Note: $key is the index of the current character.)

Michel Fortin
michel.fortin at michelf.com

More information about the Markdown-Discuss mailing list