Skip to content

Commit f1c6d6f

Browse files
authored
Update llms_txt_validation.js
1 parent 4b96095 commit f1c6d6f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

dist/llms_txt_validation.js

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

0 commit comments

Comments
 (0)