From 4520ef02abe1c2a124b979d6da0c911c8aa85f87 Mon Sep 17 00:00:00 2001 From: Kwankyu Lee Date: Sun, 4 Aug 2024 22:38:23 +0900 Subject: [PATCH] Ignore initial spaces in locating a line for anchor --- .ci/create-changes-html.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.ci/create-changes-html.sh b/.ci/create-changes-html.sh index 2cca91d81c8..6b5c431c7de 100755 --- a/.ci/create-changes-html.sh +++ b/.ci/create-changes-html.sh @@ -83,12 +83,18 @@ for block in diff_blocks: hunk_lines = [] search_result = re.search(r'@@ -(\d+),(\d+) \+(\d+),(\d+)', line) if search_result: - line_number = int(search_result.group(3)) + line_number = int(search_result.group(3)) - 1 span = int(search_result.group(4)) - for i in chain(range(line_number, line_number + span), range(line_number - 1, -1, -1)): - if content[i].startswith('<') and not content[i].startswith('' + content[i] + content[i] = ln[:idx] + f'' + ln[idx:] hunks.append(f'

hunk #{count}

') break hunk_lines.append(line)