diff options
| author | scoder <stefan_ml@behnel.de> | 2016-12-10 13:54:54 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-12-10 13:54:54 +0100 |
| commit | 7b175fc0081d557c24251dda93dc1fbc93a553a7 (patch) | |
| tree | 1961f1e55534e72f7a2d8fd6d378ea8baa123daa /src/lxml/parser.pxi | |
| parent | 18dd1d40d7eea45f77e58e8b72fa016337b0fcd2 (diff) | |
| parent | 0c139413d6b068a2bd16e253c2c89f11acad491c (diff) | |
| download | python-lxml-7b175fc0081d557c24251dda93dc1fbc93a553a7.tar.gz | |
Merge pull request #216 from plq/arskom
expose collect_ids for HTMLParser as well
Diffstat (limited to 'src/lxml/parser.pxi')
| -rw-r--r-- | src/lxml/parser.pxi | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lxml/parser.pxi b/src/lxml/parser.pxi index 639e5acf..c34406eb 100644 --- a/src/lxml/parser.pxi +++ b/src/lxml/parser.pxi @@ -1608,7 +1608,7 @@ cdef class HTMLParser(_FeedParser): u"""HTMLParser(self, encoding=None, remove_blank_text=False, \ remove_comments=False, remove_pis=False, strip_cdata=True, \ no_network=True, target=None, schema: XMLSchema =None, \ - recover=True, compact=True) + recover=True, compact=True, collect_ids=True) The HTML parser. @@ -1627,6 +1627,7 @@ cdef class HTMLParser(_FeedParser): - strip_cdata - replace CDATA sections by normal text content (default: True) - compact - save memory for short text content (default: True) - default_doctype - add a default doctype even if it is not found in the HTML (default: True) + - collect_ids - Set this to False to avoid ever-growing id cache to make ID lookups work. Other keyword arguments: @@ -1640,7 +1641,8 @@ cdef class HTMLParser(_FeedParser): def __init__(self, *, encoding=None, remove_blank_text=False, remove_comments=False, remove_pis=False, strip_cdata=True, no_network=True, target=None, XMLSchema schema=None, - recover=True, compact=True, default_doctype=True): + recover=True, compact=True, default_doctype=True, + collect_ids=True): cdef int parse_options parse_options = _HTML_DEFAULT_PARSE_OPTIONS if remove_blank_text: @@ -1655,8 +1657,8 @@ cdef class HTMLParser(_FeedParser): parse_options = parse_options ^ htmlparser.HTML_PARSE_NODEFDTD _BaseParser.__init__(self, parse_options, 1, schema, - remove_comments, remove_pis, strip_cdata, True, - target, encoding) + remove_comments, remove_pis, strip_cdata, + collect_ids, target, encoding) cdef HTMLParser __DEFAULT_HTML_PARSER |
