Skip to content

Commit d967543

Browse files
committed
Reset logger context after loading file for references
Calling the `loadAsciiDoc` appears to set the `context` used in the logger to report the file being processed. We want to retain the original context since we're only loading the file to get the targets. Fixes gh-3
1 parent 73daaf7 commit d967543

File tree

1 file changed

+4
-1
lines changed
  • packages/antora-xref-extension/lib

1 file changed

+4
-1
lines changed

packages/antora-xref-extension/lib/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,10 @@ function register ({ config }) {
4848
resource.src.asciiDocRefs = loadAsciiDocRefs((resource) => {
4949
if (file.path === resource.path) return doc
5050
const asciiDocConfigForFile = getAsciiDocConfigForFile(contentCatalog, siteAsciiDocConfig, file)
51-
return loadAsciiDoc(resource, contentCatalog, asciiDocConfigForFile)
51+
const loggerContext = doc.getLogger().context
52+
const loaded = loadAsciiDoc(resource, contentCatalog, asciiDocConfigForFile)
53+
doc.getLogger().context = loggerContext
54+
return loaded
5255
}, resource)
5356
}
5457
return resource.src.asciiDocRefs

0 commit comments

Comments
 (0)