@@ -95,6 +95,44 @@ class HTMLSerializer(object):
9595"escape_rcdata" ,"resolve_entities" ,"sanitize" )
9696
9797def __init__ (self ,** kwargs ):
98+ """Initialize HTMLSerializer.
99+
100+ Keyword options (default given first unless specified) include:
101+
102+ inject_meta_charset=True|False
103+ ..?
104+ quote_attr_values=True|False
105+ Whether to quote attribute values that don't require quoting
106+ per HTML5 parsing rules.
107+ quote_char=u'"'|u"'"
108+ Use given quote character for attribute quoting. Default is to
109+ use double quote unless attribute value contains a double quote,
110+ in which case single quotes are used instead.
111+ escape_lt_in_attrs=False|True
112+ Whether to escape < in attribute values.
113+ escape_rc_data=False|True
114+ ..?
115+ resolve_entities=True|False
116+ Whether to resolve named character entities that appear in the
117+ source tree. The XML predified entities < > & " '
118+ are unaffected by this setting.
119+ strip_whitespace=False|True
120+ ..?
121+ minimize_boolean_attributes=True|false
122+ Shortens boolean attributes to give just the attribute value,
123+ for example <input disabled="disabled"> becomes <input disabled>.
124+ use_trailing_solidus
125+ Includes a close-tag slash at the end of the start tag of void
126+ elements (empty elements whose end tag is forbidden). E.g. <hr/>.
127+ space_before_trailing_solidus
128+ Places a space immediately before the closing slash in a tag
129+ using a trailing solidus. E.g. <hr />. Requires use_trailing_solidus.
130+ sanitize
131+ Strip all unsafe or unknown constructs from output.
132+ See `html5lib user documentation`_
133+
134+ .. _html5lib user documentation: http://code.google.com/p/html5lib/wiki/UserDocumentation
135+ """
98136if kwargs .has_key ('quote_char' ):
99137self .use_best_quote_char = False
100138for attr in self .options :