From 3281d8ee8837d182003a273024fd8ce69a7f7c01 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Wed, 20 May 2009 11:14:02 -0400 Subject: [PATCH] yeah, probably should have caught that --- htmlminimizer.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htmlminimizer.py b/htmlminimizer.py index 4c90793..a9d3e50 100644 --- a/htmlminimizer.py +++ b/htmlminimizer.py @@ -9,6 +9,8 @@ out = open(output_file, 'w', encoding="utf-8") # encoding argument! important! for line in open(input_file).readlines(): # replace entities with Unicode characters for e in re.findall('&(.+?);', line): + if e in ('lt', 'gt', 'amp'): + continue n = html.entities.name2codepoint.get(e) if not n: if e.count('#x'):