diff --git a/skills/loop/write-OKF/okf-layout.md b/skills/loop/write-OKF/okf-layout.md index 9ac6c7e..876245a 100644 --- a/skills/loop/write-OKF/okf-layout.md +++ b/skills/loop/write-OKF/okf-layout.md @@ -47,7 +47,8 @@ loop, not on disk. `path:symbol`; all three resolve only if the path exists. `path:symbol` additionally needs the symbol as a literal substring of the file — that is the shape that breaks when the thing it cites moves. A `path:line` - number is a reading aid, never validated. + suffix — one number or a `92-97` range — is a reading aid, never + validated. - **Derived zone** — a page carries at most one region delimited by `` and ``, each marker alone on its line. Refresh regenerates the inside wholesale and may not diff --git a/skills/loop/write-OKF/scripts/okf-check b/skills/loop/write-OKF/scripts/okf-check index 519125c..1a378ce 100755 --- a/skills/loop/write-OKF/scripts/okf-check +++ b/skills/loop/write-OKF/scripts/okf-check @@ -17,6 +17,7 @@ import sys from pathlib import Path CAP = 110 +LINE_SUFFIX = re.compile(r"\d+(-\d+)?") def frontmatter(text): @@ -94,14 +95,14 @@ def cite_resolves(cite, page, okf): """`path` and `path:line` need the path; `path:symbol` needs both. The symbol is matched as a literal substring — no language awareness, - no tags file. A `:suffix` that parses as an integer is a reading aid, - never validated: a check that cannot fail is not a check. + no tags file. A `:suffix` that is a line number or a line range is a + reading aid, never validated: a check that cannot fail is not a check. """ path, _, symbol = cite.split("#")[0].partition(":") path, symbol = path.strip(), symbol.strip() if not path: return False - if symbol.isdigit(): + if LINE_SUFFIX.fullmatch(symbol): symbol = "" for root in (page.parent, okf, okf.parent): target = root / path