fix(docs): recognize RST-style per-column dashed rules as tables
Generate documentation / build-docs (push) Successful in 3m22s
Generate documentation / build-docs (push) Successful in 3m22s
_as_ruled_table() only matched a single solid run of dashes under the header row. The "Fish Universal Variables" table in 07-customization.md uses the other common convention instead: one dash run per column, gapped the same as the header (RST simple-table style) — e.g. "------ ----------". That line failed RULE_RE's whole-line match, so the table still fell through to a code block. Split the rule line on the same CELL_SPLIT boundary used for data rows and require every resulting group to be a solid dash run, which accepts both conventions without adding a second code path. No SSOT changes needed — the source table was already well-formed, docs/fish-config.md round-trips unchanged, confirming this is a site-only fix.
This commit is contained in:
@@ -437,6 +437,23 @@ def test_as_ruled_table_converts_header_rule_rows():
|
||||
assert "| `spwin` | Kitty or WezTerm |" in out
|
||||
|
||||
|
||||
def test_as_ruled_table_converts_per_column_dash_rule():
|
||||
"""RST-style rule (one dash run per column, gapped like the header) tables too."""
|
||||
import build_manual
|
||||
|
||||
out = build_manual._as_ruled_table(
|
||||
[
|
||||
"Variable Disables",
|
||||
"------------------------------ ------------------------------------",
|
||||
"__fish_config_op_aliases Command shadows and flag injection",
|
||||
"__fish_config_op_autoexec Startup side-effects",
|
||||
]
|
||||
)
|
||||
assert out is not None, "a per-column dashed rule was rejected"
|
||||
assert out.splitlines()[0] == "| Variable | Disables |"
|
||||
assert "| `__fish_config_op_aliases` | Command shadows and flag injection |" in out
|
||||
|
||||
|
||||
def test_as_ruled_table_folds_wrapped_continuations():
|
||||
"""A row that splits into one cell continues the previous row's last column."""
|
||||
import build_manual
|
||||
|
||||
Reference in New Issue
Block a user