Align comment parsing with Markdown
test / test (pull_request) Successful in 7s

Authored-By: Codex (GPT-5) <noreply@openai.com>
This commit is contained in:
2026-08-27 17:01:29 +00:00
parent 8a1d71c4e9
commit 9c07c5f32d
2 changed files with 20 additions and 3 deletions
+11 -3
View File
@@ -23,12 +23,14 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
if (fence_char == "`" || fence_char == "~") {
while (substr(line, fence_pos + fence_run, 1) == fence_char) fence_run++
}
if (in_fence) {
if (!in_comment && in_fence) {
print line
if (fence_char == active_fence_char && fence_run >= active_fence_run) in_fence=0
next
}
if (fence_run >= 3) {
fence_info=substr(line, fence_pos + fence_run)
valid_fence_info=(fence_char == "~" || index(fence_info, "`") == 0)
if (!in_comment && fence_run >= 3 && valid_fence_info) {
in_fence=1
active_fence_char=fence_char
active_fence_run=fence_run
@@ -52,7 +54,13 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
continue
}
if (substr(line, pos, 1) == "`") {
escaped=0
escape_pos=pos - 1
while (escape_pos >= 1 && substr(line, escape_pos, 1) == "\\") {
escaped++
escape_pos--
}
if (substr(line, pos, 1) == "`" && escaped % 2 == 0) {
ticks=1
while (substr(line, pos + ticks, 1) == "`") ticks++
close_pos=pos + ticks