diff --git a/lib/relaton/cli/yaml_convertor.rb b/lib/relaton/cli/yaml_convertor.rb index 10eeaf1..93b029c 100644 --- a/lib/relaton/cli/yaml_convertor.rb +++ b/lib/relaton/cli/yaml_convertor.rb @@ -33,7 +33,8 @@ def to_xml(file, options = {}) # @return [RelatonBib::BibliographicItem, # RelatonIso::IsoBiblioraphicItem] def convert_single_file(content) - if (processor = Registry.instance.by_type(doctype(content["docid"]))) + flavor = content.dig("ext", "flavor") || doctype(content["docid"]) + if (processor = Registry.instance.by_type(flavor)) processor.hash_to_bib content else RelatonBib::BibliographicItem.new( diff --git a/spec/acceptance/relaton_yaml2html_spec.rb b/spec/acceptance/relaton_yaml2html_spec.rb index ba4b658..fd031df 100644 --- a/spec/acceptance/relaton_yaml2html_spec.rb +++ b/spec/acceptance/relaton_yaml2html_spec.rb @@ -1,6 +1,6 @@ RSpec.describe "Relaton yaml2html" do describe "relaton yaml2html" do - it "convers the yaml file to html" do + it "converts the yaml file to html" do allow(Relaton::Cli::YAMLConvertor).to receive(:to_html) command = %w(yaml2html samplenew.yaml style.css templates)