summaryrefslogtreecommitdiff
path: root/src/lxml/html
diff options
context:
space:
mode:
authorha shao <mozbugbox@yahoo.com.au>2017-07-29 09:27:30 +0800
committerha shao <mozbugbox@yahoo.com.au>2017-07-29 09:27:30 +0800
commit03ec585f14cc5c92ca52b0cb9ea4f09fcf6ed6ef (patch)
tree1487feffe101c909b3bc2c0c00e4549c6e16bc31 /src/lxml/html
parentd2be1b2a8c7fe662534dd1b6e3adf4ef9c0f322f (diff)
downloadpython-lxml-03ec585f14cc5c92ca52b0cb9ea4f09fcf6ed6ef.tar.gz
soupparser: Use html.HtmlComment() to create commend
Diffstat (limited to 'src/lxml/html')
-rw-r--r--src/lxml/html/soupparser.py4
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("-", "&#45;")
- res = etree.Comment(bs_node)
+ res = html.HtmlComment(bs_node)
if parent is not None:
parent.append(res)
return res