mirror of
https://github.com/4gray/iptvnator.git
synced 2026-10-08 17:06:15 -08:00
fix(agents): preserve imports after bare URL punctuation
This commit is contained in:
1 parent
5a8b233840
commit
ad5050ca78
3 files changed
+17
-1
No files matched your search
@@ -72,6 +72,7 @@ existence checks as images. Entity decoding uses full HTML text/attribute rules,
|
||||
including references whose semicolon may be omitted.
|
||||
Inline guidance imports are rejected after punctuation as well as whitespace.
|
||||
At-signs inside external URLs are excluded per HTML text node, preserving adjacent imports.
|
||||
A closing bracket followed by punctuation and an at-sign terminates a bare URL exclusion.
|
||||
Extensionless inline candidates are also imports when they resolve to repository files,
|
||||
checking the full filename before prefixes at ASCII/Unicode prose separators.
|
||||
Declared scoped dependencies, scope wildcards and matching TypeScript path aliases
|
||||
|
||||
@@ -147,7 +147,7 @@ export function guidanceProse(markdown) {
|
||||
return ' ';
|
||||
if (node.nodeName === '#text')
|
||||
return node.value.replace(
|
||||
/(?:\b[a-z][a-z\d+.-]*:\/\/|\/\/)[^\s]+/giu,
|
||||
/(?:\b[a-z][a-z\d+.-]*:\/\/|\/\/)[^\s]*?(?=[)\]}>][.,;:!?]*@|\s|$)/giu,
|
||||
' '
|
||||
);
|
||||
const content = (node.childNodes ?? []).map(text).join('');
|
||||
|
||||
@@ -1489,3 +1489,18 @@ test('local HTML base uses native filesystem paths', async (t) => {
|
||||
[]
|
||||
);
|
||||
});
|
||||
|
||||
for (const boundary of [').', '];', '}']) {
|
||||
test(`bare URL preserves adjacent import after ${boundary}`, async (t) => {
|
||||
assert.ok(
|
||||
(
|
||||
await diagnostics(t, {
|
||||
'CLAUDE.md':
|
||||
'@AGENTS.md\n\nhttps://example.com/path' +
|
||||
boundary +
|
||||
'@docs/guide.md',
|
||||
})
|
||||
).some((message) => message.includes('additional or inline'))
|
||||
);
|
||||
});
|
||||
}
|
||||
Reference in new issue
Block a user