Files
docmd-io--docmd/packages/_playground/docs/en/practical-tests/phase-2/f2-self-closing-button.md
T
wehub-resource-sync 6db8fca185
docmd CI verification / verify (push) Failing after 0s
chore: import upstream snapshot with attribution
2026-07-13 12:31:55 +08:00

1.5 KiB

title, description, okf
title description okf
F2: self-closing button + orphan ::: The pre-Phase 2 parser treated self-closing ::: button as a non-self-closing container, corrupting the depth counter for everything that followed. Post-fix the orphan ::: is removed with a [normaliser] WARNING.
type
guide

F2 — self-closing button + orphan :::

This page exercises the F2 self-closing tag fix from battle-test-reports/test-report.md §F2. The pattern below used to leave an orphan ::: visible in the page AND corrupt the depth counter for any container that followed.

The pattern

::: card "Cards with self-closing buttons"
Some text.
::: button "Get Started" /getting-started
:::

The rendered result (post-fix)

::: card "Cards with self-closing buttons" Some text. ::: button "Get Started" /getting-started :::

The ::: button is a self-closing tag (per the parser's SELF_CLOSING_CONTAINER_NAMES set). The orphan ::: is removed by the container normaliser with a [normaliser] WARNING ... line in the build log. The card is closed correctly.

What the pre-fix output looked like

The ::: button was pushed to the depth stack as a normal container. The orphan ::: decremented depth of the wrong container (not the button, not the card — an arbitrary parent in the parser's state). Any container after this point on the page would have its open/close count misaligned.

OKF classification

okf.type: guide — explicit. In the OKF bundle, this page is classified as a guide and the frontmatter's okf block is preserved.