diff --git a/docs/build-manual.py b/docs/build-manual.py index f9d670d..bf4dfc2 100644 --- a/docs/build-manual.py +++ b/docs/build-manual.py @@ -315,7 +315,7 @@ def _as_ruled_table(para: list[str]) -> str | None: TREE_ROOT_RE = re.compile(r"^[~$][\w./{}-]*/$") -TREE_BRANCH_RE = re.compile(r"^[│ ]*[├└]──\s*(\S+)\s*(.*)$") +TREE_BRANCH_RE = re.compile(r"^[├└]──\s*(\S+)\s*(.*)$") def _as_file_tree(para: list[str]) -> str | None: diff --git a/docs/verify-manual.py b/docs/verify-manual.py index 7377692..58d15c6 100644 --- a/docs/verify-manual.py +++ b/docs/verify-manual.py @@ -665,6 +665,19 @@ def test_as_file_tree_rejects_non_trees(): assert build_manual._as_file_tree(para) is None, f"{label} was wrongly treed" +def test_as_file_tree_rejects_deeper_trees(): + """A tree with a second-level (indented) branch line is not detected — falls through to verbatim rendering.""" + import build_manual + + para = [ + "~/proj/", + "├── src/", + "│ └── main.fish", + "└── README.md", + ] + assert build_manual._as_file_tree(para) is None + + def test_customization_notes_render_as_aside(): """The real 07-customization.md NOTE paragraph converts to one intact