Mercurial > genshi > mirror
changeset 34:3421dd98f015 trunk
quotes should not be escaped inside text nodes
author | mgood |
---|---|
date | Sun, 02 Jul 2006 03:20:56 +0000 |
parents | 1fdb7054fb42 |
children | 35b9e9318fb1 |
files | markup/builder.py markup/core.py |
diffstat | 2 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/markup/builder.py +++ b/markup/builder.py @@ -131,6 +131,10 @@ >>> print Element('p')('Hello ', Element('b')('world')) <p>Hello <b>world</b></p> + Quotes are not escaped inside text nodes: + >>> print Element('p')('"Hello"') + <p>"Hello"</p> + Elements can also be combined with other elements or strings using the addition operator, which results in a `Fragment` object that contains the operands:
--- a/markup/core.py +++ b/markup/core.py @@ -239,7 +239,8 @@ return '<%s "%s">' % (self.__class__.__name__, self) def join(self, seq): - return Markup(unicode(self).join([escape(item) for item in seq])) + return Markup(unicode(self).join([escape(item, quotes=False) + for item in seq])) def stripentities(self, keepxmlentities=False): """Return a copy of the text with any character or numeric entities