Authored-By: Codex (GPT-5) <noreply@openai.com>
This commit is contained in:
@@ -23,12 +23,14 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
|||||||
if (fence_char == "`" || fence_char == "~") {
|
if (fence_char == "`" || fence_char == "~") {
|
||||||
while (substr(line, fence_pos + fence_run, 1) == fence_char) fence_run++
|
while (substr(line, fence_pos + fence_run, 1) == fence_char) fence_run++
|
||||||
}
|
}
|
||||||
if (in_fence) {
|
if (!in_comment && in_fence) {
|
||||||
print line
|
print line
|
||||||
if (fence_char == active_fence_char && fence_run >= active_fence_run) in_fence=0
|
if (fence_char == active_fence_char && fence_run >= active_fence_run) in_fence=0
|
||||||
next
|
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
|
in_fence=1
|
||||||
active_fence_char=fence_char
|
active_fence_char=fence_char
|
||||||
active_fence_run=fence_run
|
active_fence_run=fence_run
|
||||||
@@ -52,7 +54,13 @@ VISIBLE_BODY=$(printf '%s\n' "${BODY}" | awk '
|
|||||||
continue
|
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
|
ticks=1
|
||||||
while (substr(line, pos + ticks, 1) == "`") ticks++
|
while (substr(line, pos + ticks, 1) == "`") ticks++
|
||||||
close_pos=pos + ticks
|
close_pos=pos + ticks
|
||||||
|
|||||||
@@ -150,6 +150,15 @@ check_contract "four-space indented backticks do not expose comments" \
|
|||||||
check_contract "unequal backtick runs do not expose comments" \
|
check_contract "unequal backtick runs do not expose comments" \
|
||||||
$'`<!--``\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n-->' \
|
$'`<!--``\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n-->' \
|
||||||
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
||||||
|
check_contract "invalid backtick fence info does not expose comments" \
|
||||||
|
$'```html`oops\n<!--\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n-->' \
|
||||||
|
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
||||||
|
check_contract "fences inside comments do not expose provenance" \
|
||||||
|
$'<!--\n```html\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n-->' \
|
||||||
|
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
||||||
|
check_contract "escaped backticks do not hide a comment opener" \
|
||||||
|
$'\\`<!--\\`\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>\n-->' \
|
||||||
|
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
|
||||||
check_contract_pass "inline code containing comment opener stays visible" \
|
check_contract_pass "inline code containing comment opener stays visible" \
|
||||||
$'Use `<!--` when documenting an HTML comment opener.\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>' \
|
$'Use `<!--` when documenting an HTML comment opener.\n\n## Tracking\n- Fixes bug-x7k2m9 — https://agenthub.fritzlab.net/bug-x7k2m9\n\n## Attribution\n- Authored-By: Codex (GPT-5) <noreply@openai.com>' \
|
||||||
"$BASE" "$GOOD_HEAD"
|
"$BASE" "$GOOD_HEAD"
|
||||||
|
|||||||
Reference in New Issue
Block a user