repositories / pi-ext

pi-ext

bugabingas pi extensions

owned by bugabinga

fix(web): accept practical line context

c534b4a8300eb2168299a41db59c6e5764edaf0d

Oliver Jan Krylow <oliver@bugabinga.net> ·

SSH signature · not checked

Browse filesCompare with HEAD

Changed files (3)

extensions/web/README.md

Modified
32 32 - `linesMatching`:
33 33 optional; returns matching line excerpts instead of the full visible output.
34 34 - `contextLines`:
35 - optional; line context around `linesMatching` hits.
35 + optional; line context around `linesMatching` hits, max `100`.
36 36 - `map`
37 37 - `url`:
38 38 site URL; discovers site maps and related links without fetching page bodies.

extensions/web/__tests__/harness.test.ts

Modified
86 86 expect(props.format.description).toContain("json is Pandoc AST for HTML");
87 87 expect(props.format.description).toContain("raw skips conversion");
88 88 expect(props.linesMatching.description).toContain("Literal substrings");
89 + expect(props.contextLines.description).toContain("max 100");
89 90 expect(props.maxChars.description).toContain(
90 91 `default/max ${DEFAULT_MAX_CHARS}`,
138 139 it.each([
139 140 ["maxChars", 100, 100_000],
140 141 ["maxBytes", 1000, 100_000_000],
141 - ["contextLines", 0, 20],
142 + ["contextLines", 0, 100],
142 143 ["timeout", 5000, 600_000],
143 144 ["maxUrls", 1, 10_000],
144 145 ["maxSitemaps", 1, 100],

extensions/web/index.ts

Modified
790 790 contextLines: Type.Optional(
791 791 Type.Number({
792 - description: "Context lines per match (default 0).",
792 + description: "Context lines per match (default 0, max 100).",
793 793 minimum: 0,
794 - maximum: 20,
794 + maximum: 100,
797 797 caseSensitive: Type.Optional(