summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Allen <dan.j.allen@gmail.com>2022-02-27 23:46:09 -0700
committerDan Allen <dan.j.allen@gmail.com>2022-02-28 00:36:27 -0700
commite8c909cf2f6e696eb42d08ef49100df4132f0b0e (patch)
tree29208a0105141eda6167cc8dfff626282ca0176b /lib
parent5206b40fcd8dc8f79e2097a307ef530b8b82d789 (diff)
if path is included both partially and fully, store it with true value (included fully) in includes table of document catalog
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor/reader.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/asciidoctor/reader.rb b/lib/asciidoctor/reader.rb
index f9530112..257557e3 100644
--- a/lib/asciidoctor/reader.rb
+++ b/lib/asciidoctor/reader.rb
@@ -678,7 +678,7 @@ class PreprocessorReader < Reader
# 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
+ @includes[path.slice 0, (path.rindex '.')] ||= attributes['partial-option'] ? nil : true
end
else
@dir = '.'
@@ -686,7 +686,7 @@ class PreprocessorReader < Reader
@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
+ @includes[Helpers.rootname path] ||= attributes['partial-option'] ? nil : true
else
@path = '<stdin>'
end