Skip to content

Commit 4615e62

Browse files
authored
Merge pull request #117 from relaton/fix/yaml-flavor
use ext/flavor before docidentifier prefix to determine Relaton flavo…
2 parents cbac3e7 + cb9f569 commit 4615e62

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

lib/relaton/cli/yaml_convertor.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def to_xml(file, options = {})
3333
# @return [RelatonBib::BibliographicItem,
3434
# RelatonIso::IsoBiblioraphicItem]
3535
def convert_single_file(content)
36-
if (processor = Registry.instance.by_type(doctype(content["docid"])))
36+
flavor = content.dig("ext", "flavor") || doctype(content["docid"])
37+
if (processor = Registry.instance.by_type(flavor))
3738
processor.hash_to_bib content
3839
else
3940
RelatonBib::BibliographicItem.new(

spec/acceptance/relaton_yaml2html_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
RSpec.describe "Relaton yaml2html" do
22
describe "relaton yaml2html" do
3-
it "convers the yaml file to html" do
3+
it "converts the yaml file to html" do
44
allow(Relaton::Cli::YAMLConvertor).to receive(:to_html)
55
command = %w(yaml2html samplenew.yaml style.css templates)
66

0 commit comments

Comments
 (0)