fix: remember to set lastIndex = 0 on shared RegExp

This commit is contained in:
Michael Bolin
2025-05-13 11:58:26 -07:00
parent 557f608f25
commit 0e470f424b

View File

@@ -330,6 +330,7 @@ function rewriteFileCitations(
return markdown;
}
citationRegex.lastIndex = 0;
return markdown.replace(citationRegex, (_match, file, start, _end) => {
const absPath = path.resolve(cwd, file);
const uri = `${fileOpener}://file${absPath}:${start}`;