summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2021-04-20 23:35:09 -0600
committerDan Allen <dan.j.allen@gmail.com>2021-04-20 23:35:09 -0600
commit3fa8ec76f1f7d9d7905a387bbcbcbe5ecbffe920 (patch)
treeacb99e046df8ef776270a77488263f7cc1522376 /lib
parent356069071d48f9cbaeed54fb65a20239a69f14bd (diff)
add comment why include with partial-option is set is registered with a nil value [skip ci]
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/reader.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/asciidoctor/reader.rb b/lib/asciidoctor/reader.rb
index 7767cad2..6d0708cc 100644
--- a/lib/asciidoctor/reader.rb
+++ b/lib/asciidoctor/reader.rb
@@ -690,6 +690,7 @@ class PreprocessorReader < Reader
@path = (path ||= ::File.basename file)
# only process lines in AsciiDoc files
if (@process_lines = file.end_with?(*ASCIIDOC_EXTENSIONS.keys))
+ # NOTE registering the include with a nil value tracks it while not making it visible to interdocument xrefs
@includes[path.slice 0, (path.rindex '.')] = attributes['partial-option'] ? nil : true
end
else
@@ -697,6 +698,7 @@ class PreprocessorReader < Reader
# we don't know what file type we have, so assume AsciiDoc
@process_lines = true
if (@path = path)
+ # NOTE registering the include with a nil value tracks it while not making it visible to interdocument xrefs
@includes[Helpers.rootname path] = attributes['partial-option'] ? nil : true
else
@path = '<stdin>'