# HG changeset patch # User cmlenz # Date 1163179552 0 # Node ID 2304e080ec070f3eff434dc976c40efa37a5ad75 # Parent 8e75b83d3e71e19d6761f070f38b553ed14f41b6 Whitespace was not getting preserved in HTML `
` elements that contained other HTML elements. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,9 @@ are callable. * Instances of the `genshi.core.Attrs` class are now immutable (they are subclasses of `tuple` instead of `list`). + * Preserve whitespace in HTML `` elements also when they contained any + child elements. + Version 0.3.4 http://svn.edgewall.org/repos/genshi/tags/0.3.4/ diff --git a/genshi/output.py b/genshi/output.py --- a/genshi/output.py +++ b/genshi/output.py @@ -183,7 +183,10 @@ _BOOLEAN_ATTRS = frozenset(['selected', 'checked', 'compact', 'declare', 'defer', 'disabled', 'ismap', 'multiple', 'nohref', 'noresize', 'noshade', 'nowrap']) - _PRESERVE_SPACE = frozenset([QName('pre'), QName('textarea')]) + _PRESERVE_SPACE = frozenset([ + QName('pre'), QName('http://www.w3.org/1999/xhtml}pre'), + QName('textarea'), QName('http://www.w3.org/1999/xhtml}textarea') + ]) def __call__(self, stream): namespace = self.NAMESPACE @@ -461,8 +464,8 @@ @param noescape: a set or sequence of tag names for which text content should not be escaped - Both the `preserve` and `noescape` sets are expected to refer to - elements that cannot contain further child elements. + The `noescape` set is expected to refer to elements that cannot contain + further child elements (such as