forked from heavy-duty/ceremony
fix: preserve Refs keyword boundaries (#234)
This commit is contained in:
parent
5232027361
commit
d712f0636f
2 changed files with 5 additions and 1 deletions
|
|
@ -213,7 +213,9 @@ refs_references() { # PR body on stdin -> local issue numbers named by Refs
|
||||||
token = substr(rest, RSTART, RLENGTH)
|
token = substr(rest, RSTART, RLENGTH)
|
||||||
sub(/^.*refs[[:space:]:]+/, "", token)
|
sub(/^.*refs[[:space:]:]+/, "", token)
|
||||||
print 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 \
|
' | issue_references \
|
||||||
|
|
|
||||||
|
|
@ -117,6 +117,8 @@ check "parenthesized prose after a local Refs token is ignored" 0 "" \
|
||||||
test "$(refs_references <<<'Refs #175 (split from #150)')" = 175
|
test "$(refs_references <<<'Refs #175 (split from #150)')" = 175
|
||||||
check "every Refs occurrence on one line contributes its bound token" 0 "" \
|
check "every Refs occurrence on one line contributes its bound token" 0 "" \
|
||||||
test "$(refs_references <<<'Refs #8. Refs #9.')" = $'8\n9'
|
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 "" \
|
check "lowercase refs in unrelated prose declares nothing" 0 "" \
|
||||||
test -z "$(refs_references <<<'fix refs parsing from #200')"
|
test -z "$(refs_references <<<'fix refs parsing from #200')"
|
||||||
check "Refs without a following token declares nothing" 0 "" \
|
check "Refs without a following token declares nothing" 0 "" \
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue