lib/asciidoctor-bibliography/options.rb in asciidoctor-bibliography-0.7.0 vs lib/asciidoctor-bibliography/options.rb in asciidoctor-bibliography-0.7.2

- old
+ new

@@ -20,13 +20,14 @@ def initialize merge DEFAULTS end - def self.new_from_reader(reader) + def self.build(document, reader) header_attributes = get_header_attributes_hash reader header_attributes.select! { |key, _| DEFAULTS.keys.include? key } - new.merge header_attributes + cli_attributes = document.attributes.select { |key, _| DEFAULTS.keys.include? key } + new.merge!(header_attributes).merge!(cli_attributes) end def self.get_header_attributes_hash(reader) # We peek at the document attributes we need, without perturbing the parsing flow. # NOTE: we'll use this in a preprocessor and they haven't been parsed yet, there.