@@ -210,6 +210,59 @@ Just text, no links here.
210210 expect ( result . message ) . toContain ( 'sampled links' ) ;
211211 } ) ;
212212
213+ it ( 'passes for .txt companion files that contain markdown' , async ( ) => {
214+ server . use (
215+ http . head (
216+ 'http://test.local/llms-full.txt' ,
217+ ( ) =>
218+ new HttpResponse ( null , {
219+ status : 200 ,
220+ headers : { 'content-type' : 'text/plain' } ,
221+ } ) ,
222+ ) ,
223+ http . get (
224+ 'http://test.local/llms-full.txt' ,
225+ ( ) =>
226+ new HttpResponse (
227+ '# Full docs\n\n## API Reference\n\n- [Endpoint](http://test.local/api.md): API' ,
228+ {
229+ status : 200 ,
230+ headers : { 'content-type' : 'text/plain' } ,
231+ } ,
232+ ) ,
233+ ) ,
234+ ) ;
235+
236+ const content = `# Test\n> Summary\n## Links\n- [Full docs](http://test.local/llms-full.txt): Complete documentation\n` ;
237+ const result = await check . run ( makeCtx ( content ) ) ;
238+ expect ( result . status ) . toBe ( 'pass' ) ;
239+ } ) ;
240+
241+ it ( 'fails for .txt files that do not contain markdown' , async ( ) => {
242+ server . use (
243+ http . head (
244+ 'http://test.local/robots.txt' ,
245+ ( ) =>
246+ new HttpResponse ( null , {
247+ status : 200 ,
248+ headers : { 'content-type' : 'text/plain' } ,
249+ } ) ,
250+ ) ,
251+ http . get (
252+ 'http://test.local/robots.txt' ,
253+ ( ) =>
254+ new HttpResponse ( 'User-agent: *\nDisallow: /private/' , {
255+ status : 200 ,
256+ headers : { 'content-type' : 'text/plain' } ,
257+ } ) ,
258+ ) ,
259+ ) ;
260+
261+ const content = `# Test\n> Summary\n## Links\n- [Robots](http://test.local/robots.txt): Robots file\n` ;
262+ const result = await check . run ( makeCtx ( content ) ) ;
263+ expect ( result . status ) . toBe ( 'fail' ) ;
264+ } ) ;
265+
213266 it ( 'uses toMdUrls to find .md variants (handles trailing slash and .html)' , async ( ) => {
214267 server . use (
215268 http . head (
0 commit comments