From 67eb998901777eabca711189e1ecf8727b8b02fa Mon Sep 17 00:00:00 2001 From: Henrik Levkowetz Date: Tue, 12 Jun 2007 00:37:16 +0000 Subject: [PATCH] soup2html() tweak to handle html comments. - Legacy-Id: 328 --- ietf/utils/soup2text.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ietf/utils/soup2text.py b/ietf/utils/soup2text.py index cda9e6ea8..7e050a48b 100755 --- a/ietf/utils/soup2text.py +++ b/ietf/utils/soup2text.py @@ -51,6 +51,8 @@ def normalize(str): # Normalize whitespace at the beginning and end of the string str = re.sub("^[ \t\n]+", " ", str) str = re.sub("[ \t\n]+$", " ", str) + # remove comments + str = re.sub("(?s)", "", str) # remove xml PIs and metainformation str = re.sub("]*>", "", str) str = re.sub("<\?[^>]*\?>", "", str)