Tokenize open disclosure attributes
test / test (pull_request) Successful in 6s

Authored-By: Codex (GPT-5) <noreply@openai.com>
This commit is contained in:
2026-08-27 17:48:43 +00:00
parent b8580d2082
commit 79d6ba5be9
3 changed files with 10 additions and 3 deletions
+3 -1
View File
@@ -55,9 +55,11 @@ VISIBLE_BODY=$(printf '%s\n' "${RENDERED_BODY}" |
if (char == ">") { if (char == ">") {
lower=tolower(tag) lower=tolower(tag)
if (lower ~ /^<details([[:space:]>])/) { if (lower ~ /^<details([[:space:]>])/) {
attributes=lower
gsub(/"[^"]*"/, "", attributes)
parent_hidden=(details_depth > 0 && hidden[details_depth]) parent_hidden=(details_depth > 0 && hidden[details_depth])
details_depth++ details_depth++
hidden[details_depth]=(parent_hidden || lower !~ /[[:space:]]open([[:space:]=>]|$)/) hidden[details_depth]=(parent_hidden || attributes !~ /[[:space:]]open([[:space:]=>]|$)/)
} }
else if (lower ~ /^<\/details([[:space:]>])/) { else if (lower ~ /^<\/details([[:space:]>])/) {
if (details_depth > 0) { if (details_depth > 0) {
+4 -2
View File
@@ -62,8 +62,10 @@ printf '%s\n' "${PR_BODY}" | awk '
next next
} }
if (lower ~ /^[ ]{0,3}<details([[:blank:]>])/) { if (lower ~ /^[ ]{0,3}<details([[:blank:]>])/) {
if (lower ~ /[[:blank:]]open([[:blank:]=>]|$)/) print "<details open=\"\">" attributes=lower
else print "<details>" gsub(/"[^"]*"/, "", attributes)
if (attributes ~ /[[:blank:]]open([[:blank:]=>]|$)/) sub(/<details open>/, "<details open=\"\">", line)
print line
next next
} }
if (line ~ /^## Tracking[[:space:]]*$/) print "<h2>Tracking</h2>" if (line ~ /^## Tracking[[:space:]]*$/) print "<h2>Tracking</h2>"
+3
View File
@@ -185,6 +185,9 @@ check_contract_pass "open details preserve visible provenance" \
check_contract "open details inside collapsed details remain hidden" \ check_contract "open details inside collapsed details remain hidden" \
$'<details><summary>Release notes</summary>\n<details open><summary>Visible only after expansion</summary>\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</details>\n</details>' \ $'<details><summary>Release notes</summary>\n<details open><summary>Visible only after expansion</summary>\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</details>\n</details>' \
"$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 "open text in another details attribute remains collapsed" \
$'<details title="x open y"><summary>Release notes</summary>\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</details>' \
"$BASE" "$GOOD_HEAD" "PR body must contain a non-empty ## Tracking section"
check_contract_pass "unrelated collapsed details remain available" \ check_contract_pass "unrelated collapsed details remain available" \
$'<details><summary>Logs</summary>\n\nSupporting output\n</details>\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>' \ $'<details><summary>Logs</summary>\n\nSupporting output\n</details>\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"