Skip to content

Commit ca3538f

Browse files
authored
Validation Changes
Making LLMs.txt scoring less strict, so present - yet malformed llms.txt files - will always be marked as "valid", rather than invalid to make it easier to count total adoption whilst understanding which files have errors or not.
1 parent da43f5e commit ca3538f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

dist/llms_txt_validation.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ return fetchWithTimeout('/llms.txt')
1313
if (!ct.toLowerCase().includes('text/plain')) return JSON.stringify({valid: false, message: ct, error: "Invalid content type"});
1414
return response.text().then(text => {
1515
const m = s => (text.match(new RegExp(`\\${s}`,'g'))||[]).length;
16-
if (m('[')!==m(']')||m('(')!==m(')')) return JSON.stringify({valid: false, error: "Invalid markdown: Unmatched braces"});
17-
if ((text.match(/```/g)||[]).length %2) return JSON.stringify({valid: false, error: "Invalid markdown: Uneven code fences"});
16+
if (m('[')!==m(']')||m('(')!==m(')')) return JSON.stringify({valid: true, error: "Invalid markdown: Unmatched braces"});
17+
if ((text.match(/```/g)||[]).length %2) return JSON.stringify({valid: true, error: "Invalid markdown: Uneven code fences"});
1818
return JSON.stringify({valid: true});
1919
});
2020
})

0 commit comments

Comments
 (0)