Skip to content

Commit 1e25043

Browse files
committed
Escape only what is necessary
1 parent aaf7535 commit 1e25043

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

markdown/htmlparser.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,10 +256,9 @@ def handle_entityref(self, name: str):
256256

257257
def handle_comment(self, data: str):
258258
# Check if the comment is unclosed, if so, we need to override position
259-
# update
260259
i = self.line_offset + self.offset + len(data) + 4
261260
if self.rawdata[i:i + 3] != '-->':
262-
self.handle_data('<!--')
261+
self.handle_data('<')
263262
self.override_comment_update = True
264263
return
265264
self.handle_empty_tag('<!--{}-->'.format(data), is_block=True)
@@ -268,7 +267,7 @@ def updatepos(self, i: int, j: int) -> int:
268267
if self.override_comment_update:
269268
self.override_comment_update = False
270269
i = 0
271-
j = 4
270+
j = 1
272271
return super().updatepos(i, j)
273272

274273
def handle_decl(self, data: str):

0 commit comments

Comments
 (0)