Skip to content

Commit 458b1d6

Browse files
committed
remove unused code block
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent c87cf1b commit 458b1d6

2 files changed

Lines changed: 4 additions & 33 deletions

File tree

src/utils/markdown_repair.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -39,39 +39,6 @@
3939
_COMMENT_CLOSE: Final[str] = "-->"
4040

4141

42-
def _strip_comments(line: str, in_comment: bool) -> tuple[str, bool]:
43-
"""Remove HTML comment regions from *line* for scanning purposes.
44-
45-
Parameters:
46-
line: A single line of text to process.
47-
in_comment: Whether we are currently inside an HTML comment
48-
from a previous line.
49-
50-
Returns:
51-
A tuple of (visible_content, updated_in_comment) where
52-
visible_content has comment regions removed and
53-
updated_in_comment reflects whether a comment is still open.
54-
"""
55-
result: list[str] = []
56-
i = 0
57-
while i < len(line):
58-
if in_comment:
59-
end = line.find(_COMMENT_CLOSE, i)
60-
if end == -1:
61-
break
62-
i = end + len(_COMMENT_CLOSE)
63-
in_comment = False
64-
else:
65-
start = line.find(_COMMENT_OPEN, i)
66-
if start == -1:
67-
result.append(line[i:])
68-
break
69-
result.append(line[i:start])
70-
i = start + len(_COMMENT_OPEN)
71-
in_comment = True
72-
return "".join(result), in_comment
73-
74-
7542
def _process_html_tags(line: str, html_stack: list[str]) -> Optional[str]:
7643
"""Update *html_stack* with block-level HTML open/close tags found in *line*.
7744

tests/unit/utils/test_markdown_repair.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,6 +446,10 @@ def test_style_same_line_close_after_comment_no_trailing(self) -> None:
446446
result = close_open_markdown(text)
447447
assert result == ""
448448

449+
450+
class TestCloseOpenMarkdownRawTagCommentInteraction:
451+
"""Tests for raw-tag and comment interaction on the same line."""
452+
449453
def test_script_close_then_comment_then_tag_same_line(self) -> None:
450454
"""Closed script then closed comment then open tag on one line."""
451455
text = "<script>x</script><!-- ok --><div>text"

0 commit comments

Comments
 (0)