diff options
| author | ha shao <mozbugbox@yahoo.com.au> | 2017-07-29 09:27:30 +0800 |
|---|---|---|
| committer | ha shao <mozbugbox@yahoo.com.au> | 2017-07-29 09:27:30 +0800 |
| commit | 03ec585f14cc5c92ca52b0cb9ea4f09fcf6ed6ef (patch) | |
| tree | 1487feffe101c909b3bc2c0c00e4549c6e16bc31 /src/lxml/html | |
| parent | d2be1b2a8c7fe662534dd1b6e3adf4ef9c0f322f (diff) | |
| download | python-lxml-03ec585f14cc5c92ca52b0cb9ea4f09fcf6ed6ef.tar.gz | |
soupparser: Use html.HtmlComment() to create commend
Diffstat (limited to 'src/lxml/html')
| -rw-r--r-- | src/lxml/html/soupparser.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lxml/html/soupparser.py b/src/lxml/html/soupparser.py index 44756aa6..19d9c938 100644 --- a/src/lxml/html/soupparser.py +++ b/src/lxml/html/soupparser.py @@ -255,9 +255,7 @@ def _init_node_converters(makeelement): @converter(Comment) def convert_comment(bs_node, parent): - if "--" in bs_node or bs_node.endswith("-"): - bs_node = bs_node.replace("-", "-") - res = etree.Comment(bs_node) + res = html.HtmlComment(bs_node) if parent is not None: parent.append(res) return res |
