fix: preserve Refs keyword boundaries (#234)

This commit is contained in:
codex-bot-andresmgsl 2026-08-24 16:13:19 +00:00
parent 5232027361
commit d712f0636f
2 changed files with 5 additions and 1 deletions

View file

@ -213,7 +213,9 @@ refs_references() { # PR body on stdin -> local issue numbers named by Refs
token = substr(rest, RSTART, RLENGTH)
sub(/^.*refs[[:space:]:]+/, "", token)
print token
rest = substr(rest, RSTART + RLENGTH)
# Retain the token final byte so ^ cannot turn a concatenated
# alphanumeric suffix into a fresh keyword boundary (#234).
rest = substr(rest, RSTART + RLENGTH - 1)
}
}
' | issue_references \

View file

@ -117,6 +117,8 @@ check "parenthesized prose after a local Refs token is ignored" 0 "" \
test "$(refs_references <<<'Refs #175 (split from #150)')" = 175
check "every Refs occurrence on one line contributes its bound token" 0 "" \
test "$(refs_references <<<'Refs #8. Refs #9.')" = $'8\n9'
check "a concatenated Refs spelling is not a second keyword occurrence" 0 "" \
test "$(refs_references <<<'Refs #8Refs #9')" = 8
check "lowercase refs in unrelated prose declares nothing" 0 "" \
test -z "$(refs_references <<<'fix refs parsing from #200')"
check "Refs without a following token declares nothing" 0 "" \