turva-llms-txt-validator 0.8.5 → 0.8.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -86,7 +86,7 @@ Completed validation returns `{ target, summary, checks }`, where `target` is `h
86
86
 
87
87
  The validator removes C0 and C1 control characters, bidirectional controls and invisible characters from the `detail` text, which can quote the checked site. The invisible characters are chosen by Unicode class, not from a list: every format character, which is General_Category Cf, every Default_Ignorable_Code_Point and the line and paragraph separators U+2028 and U+2029. That covers the zero-width characters, the left-to-right and right-to-left marks, the Arabic letter mark, the word joiner and the invisible math operators, the soft hyphen, the byte-order mark, the variation selectors, the combining grapheme joiner, the Hangul fillers and the tag characters U+E0000 to U+E007F. Spaces stay: the no-break space and U+2000 to U+200A. The zero-width non-joiner and joiner go too, so a quoted Persian, Malayalam or Devanagari word loses its joining marks and reads without them. The Arabic number signs U+0600 to U+0605 go as well. Until 0.8.0 only the bidi controls and the C0 and C1 controls were removed, and the invisible characters stayed in the text and in the JSON. An emoji sequence in quoted text loses its zero-width joiners and its variation selector: a family emoji reads as its members side by side, a heart written with U+FE0F shows in text style, a keycap sequence loses the selector, and a tag flag shows as its black flag. The emoji themselves, skin tone modifiers, regional indicators and combining marks stay.
88
88
 
89
- With `--json`, an invalid domain or a failed fetch returns `{ "error": "...", "target": "..." }` and exits with code `2`. A network error adds `code`, such as `EAI_AGAIN`. An unknown option, a second domain and a missing domain return `{ "error": "..." }` only, with no target, and also exit with code `2`. `--help` and `--version` win over argument errors, also with `--json`, and exit with code `0`. An unknown option is named by its dashes and the letters, digits and dashes after them, and the rest of the argument is not shown, so a target typed with a leading dash, as in `-u:secret@example.com`, gives `unknown option "-u" (the rest of the argument is not shown)`.
89
+ With `--json`, an invalid domain or a failed fetch returns `{ "error": "...", "target": "..." }` and exits with code `2`. A network error adds `code` when the error carries one, such as `EAI_AGAIN`. An unknown option, a second domain and a missing domain return `{ "error": "..." }` only, with no target, and also exit with code `2`. `--help` and `--version` win over argument errors, also with `--json`, and exit with code `0`. An unknown option is named by its dashes and the letters, digits and dashes after them, and the rest of the argument is not shown, so a target typed with a leading dash, as in `-u:secret@example.com`, gives `unknown option "-u" (the rest of the argument is not shown)`.
90
90
 
91
91
  In an error report the `target` is the address given on the command line. When it parses as a URL with a host, the user name and password are removed and each query value becomes `***`. Other values follow these cases:
92
92
 
@@ -253,12 +253,12 @@ The strict type check found two inputs that could leave `undefined` in a check's
253
253
  GitHub Actions publishes every version from 0.1.3 on with npm trusted publishing, and each one carries a provenance attestation. To check one, install it in an empty directory and ask npm to verify the signatures. Replace the version with the one you want to check.
254
254
 
255
255
  ```sh
256
- mkdir verify-llms && cd verify-llms && npm init -y && npm install turva-llms-txt-validator@0.8.5 --ignore-scripts && npm audit signatures
256
+ mkdir verify-llms && cd verify-llms && npm init -y && npm install turva-llms-txt-validator@0.8.6 --ignore-scripts && npm audit signatures
257
257
  ```
258
258
 
259
259
  `npm audit signatures` checks the registry signature and the provenance attestation of each installed package that has one. The attestation of this package names three things to compare with what you expect: the repository, the workflow file `.github/workflows/publish.yml` and the commit that produced the tarball. Versions up to and including 0.8.4 were built in `github.com/erekola/llms-txt-validator`, before the repository moved to the turva-dev organization on 2026-11-25. Every later release is built in `github.com/turva-dev/llms-txt-validator`. The npm version page shows them under Provenance.
260
260
 
261
- Tag `v0.8.5` must point at that same commit, and `gh api repos/turva-dev/llms-txt-validator/commits/v0.8.5 --jq .sha` prints it. A mismatch is a reason not to use that version. Provenance proves which workflow built a release and from which commit. It does not prove that the code is safe, so reading the source and the dependencies stays your job.
261
+ Tag `v0.8.6` must point at that same commit, and `gh api repos/turva-dev/llms-txt-validator/commits/v0.8.6 --jq .sha` prints it. A mismatch is a reason not to use that version. Provenance proves which workflow built a release and from which commit. It does not prove that the code is safe, so reading the source and the dependencies stays your job.
262
262
 
263
263
  ## Development
264
264
 
package/dist/src/index.js CHANGED
@@ -2062,8 +2062,10 @@ export function validateLlmsTxt(f) {
2062
2062
  itemOpen = false;
2063
2063
  continue;
2064
2064
  }
2065
- const h1 = /^ {0,3}#(?:[ \t]|$)/.test(l) || sx.text[i];
2066
- if (misplaced === -1 && i > firstIdx && (h1 || (!seenH2 && /^ {0,3}#{3,6}(?:[ \t]|$)/.test(l))))
2065
+ // A line inside a raw HTML block is no heading for these checks either (h2Mask also holds the fenced lines,
2066
+ // which were skipped above, so here it only adds the HTML block lines).
2067
+ const h1 = !h2Mask[i] && (/^ {0,3}#(?:[ \t]|$)/.test(l) || sx.text[i]);
2068
+ if (misplaced === -1 && i > firstIdx && (h1 || (!seenH2 && !h2Mask[i] && /^ {0,3}#{3,6}(?:[ \t]|$)/.test(l))))
2067
2069
  misplaced = i;
2068
2070
  if (h1) {
2069
2071
  inSection = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "turva-llms-txt-validator",
3
- "version": "0.8.5",
3
+ "version": "0.8.6",
4
4
  "description": "Validate a site's llms.txt structure: eight checks as pass/warn/fail plus two llms.txt v2 discovery checks that read pass or info and never move the summary, JSON output. Same checks as the hosted validator at turva.dev/llms-txt-validator.",
5
5
  "type": "module",
6
6
  "main": "./dist/src/index.js",