# HG changeset patch # User cmlenz # Date 1180517634 0 # Node ID 942d73ba938cca422f9c3039e4a72ae881fff370 # Parent 3f6582a5a4a566a190598dfbb79b23cf79b6e4bf The `doctype` parameter for serializers can now be a string. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,16 @@ * Added #include directive for text templates (ticket #115). +Version 0.4.2 +http://svn.edgewall.org/repos/genshi/tags/0.4.2/ +(?, from branches/stable/0.4.x) + + * The `doctype` parameter of the markup serializers now also accepts the "name" + of the doctype as string, in addition to the `(name, pubid, sysid)` tuple. + * The I18n filter was not replacing the original attributes with the + translation, but instead adding a second attribute with the same name. + + Version 0.4.1 http://svn.edgewall.org/repos/genshi/tags/0.4.1/ (May 21 2007, from branches/stable/0.4.x) diff --git a/genshi/output.py b/genshi/output.py --- a/genshi/output.py +++ b/genshi/output.py @@ -150,12 +150,16 @@ :param doctype: a ``(name, pubid, sysid)`` tuple that represents the DOCTYPE declaration that should be included at the top - of the generated output + of the generated output, or the name of a DOCTYPE as + defined in `DocType.get` :param strip_whitespace: whether extraneous whitespace should be stripped from the output + :note: Changed in 0.4.2: The `doctype` parameter can now be a string. """ self.preamble = [] if doctype: + if isinstance(doctype, basestring): + doctype = DocType.get(doctype) self.preamble.append((DOCTYPE, doctype, (None, -1, -1))) self.filters = [EmptyTagFilter()] if strip_whitespace: