From fb06c9cf6551c4e66b03e40005c01ee212204a2c Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Sep 02 2011 05:09:57 +0000 Subject: Update `CentOS-Web/Apps/xhtml.py'. --- diff --git a/Scripts/CentOS-Web/Apps/xhtml.py b/Scripts/CentOS-Web/Apps/xhtml.py index 6ffeab7..6bb7d6f 100755 --- a/Scripts/CentOS-Web/Apps/xhtml.py +++ b/Scripts/CentOS-Web/Apps/xhtml.py @@ -17,10 +17,11 @@ # ------------------------------------------------------------------ # $Id$ # ------------------------------------------------------------------ -""" -This module (App.xhtml) encapsulates the output code needed by web -applications, using the Extensible HTML version 1.0 DTDs -(/usr/share/sgml/xhtml1/xhtml1-20020801/DTD/) as reference. +"""This module provides support to XHTML construction. + +XHTML construction, as set here, uses the Extensible HTML version 1.0 +DTDs (/usr/share/sgml/xhtml1/xhtml1-20020801/DTD/) as reference. XHTML +construction is required by page module. """ @@ -375,8 +376,16 @@ class Strict: %attrs; > + When content is introduced inside the database, it goes + without any XHTML markup. This method transforms newline + separated strings into XHTML paragraphs. + """ - return self.tag('p', attrs, indent, content, has_child) + output = '' + for line in content.splitlines(): + if line == '': continue + output += self.tag('p', attrs, indent, line.strip(), has_child) + return output # ------------------------------------------------------------------