Files
Matt Van Horn b74c4a3ec7 fix(markdown-preprocess): preserve unknown tokens in render()
The Quadlet documentation rewrite added a render() pass that handles
`<<if VAR>>...<<endif>>` and `<<X if cond else Y>>` conditionals before
the existing `<<a|b>>` substitution and `<<subcommand>>` replacement run.
Tokens that didn't match the new conditional grammar were silently
consumed instead of passed through, so any `<<a|b>>` whose content
didn't fit the conditional shape disappeared from the rendered output.

The user-visible regression (containers/podman#28645) was the line in
options/sysctl.md:

  Note: <<if using the **--ipc=host** option|...>>, the above sysctls
  are not allowed.

Both halves of the substitution start with "if", so the inner string
matched `inner.startswith("if ")`, but the rest of the conditional
recogniser fell through and the whole token was dropped. The same
codepath also dropped `<<subcommand>>` tokens, which insert_file()
expects to replace later.

Fix: when none of the conditional/inline-if branches match, append the
original `<<...>>` token verbatim so downstream replace_type and
`<<subcommand>>` replacement can handle it. Add render() tests covering
the conditional grammar plus the regression case.

Verified by rendering all 307 files under docs/source/markdown/options/
in both is_quadlet=True and is_quadlet=False contexts; no failures.

Closes #28645

Signed-off-by: Matt Van Horn <mvanhorn@gmail.com>
2026-05-05 03:27:34 -07:00
..
2022-09-23 09:58:39 +01:00
2025-12-17 14:37:12 +01:00