[med-svn] r1382 - trunk/community/infrastructure/test
tille at alioth.debian.org
tille at alioth.debian.org
Fri Feb 15 20:14:17 UTC 2008
Author: tille
Date: 2008-02-15 20:14:16 +0000 (Fri, 15 Feb 2008)
New Revision: 1382
Modified:
trunk/community/infrastructure/test/cddtasktools.py
Log:
Handle paragraph separators
Modified: trunk/community/infrastructure/test/cddtasktools.py
===================================================================
--- trunk/community/infrastructure/test/cddtasktools.py 2008-02-15 16:14:38 UTC (rev 1381)
+++ trunk/community/infrastructure/test/cddtasktools.py 2008-02-15 20:14:16 UTC (rev 1382)
@@ -18,6 +18,7 @@
import urllib
import StringIO
import gzip
+import re
from debian_bundle import deb822
@@ -51,10 +52,13 @@
ShortDesc = lines[0]
LongDesc = ''
for line in lines[1:]:
- LongDesc += line.strip() + ' \n'
- # This is to sanitize output for XHTML pages. --David
- LongDesc = LongDesc.replace("&", "&").replace("<", "<").replace(">", ">")
- LongDesc = LongDesc.replace("\n .\n", "<br /><br />").replace("\n", "")
+ line = line.strip()
+ # Replace paragraph separators by <br />
+ if re.compile("^\s?\.\s*$").search(line):
+ LongDesc += "<br />\n"
+ else:
+ # This is to sanitize output for XHTML pages. --David
+ LongDesc += line.replace("&", "&").replace("<", "<").replace(">", ">") + ' \n'
return (ShortDesc, LongDesc)
More information about the debian-med-commit
mailing list