8000 Address concerns expressed in: · html5lib/html5lib-python@77700c0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 77700c0

Browse files
committed
Address concerns expressed in:
http://groups.google.com/group/html5lib-discuss/browse_frm/thread/73eebe5a81a70029 --HG-- extra : convert_revision : svn%3Aacbfec75-9323-0410-a652-858a13e371e0/trunk%40820
1 parent 7217e1d commit 77700c0

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/html5lib/serializer/htmlserializer.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,17 @@ class HTMLSerializer(object):
7373

7474
inject_meta_charset = True
7575

76+
options = ("quote_attr_values", "quote_char", "use_best_quote_char",
77+
"minimize_boolean_attributes", "use_trailing_solidus",
78+
"space_before_trailing_solidus", "omit_optional_tags",
79+
"strip_whitespace", "inject_meta_charset", "escape_lt_in_attrs",
80+
"escape_rcdata")
81+
7682
def __init__(self, **kwargs):
7783
if kwargs.has_key('quote_char'):
7884
self.use_best_quote_char = False
79-
for name,value in kwargs.items():
80-
if name in dir(self.__class__) and not name.startswith('_'):
81-
setattr(self, name, value)
85+
for attr in self.options:
86+
setattr(self, attr, kwargs.get(attr, getattr(self, attr)))
8287
self.errors = []
8388
self.strict = False
8489

0 commit comments

Comments
 (0)
0