Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew2net committed Jul 29, 2022
1 parent dffbfb0 commit 36fcdb8
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/relaton_bib/bibxml_parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,10 @@ def organization(contrib)
# "front/author[not(@surname)][not(@fullname)]/organization",
# ).map do |org|
org = contrib.at("./organization")
name = ORGNAMES[org.text] || org.text
orgname = org.text.strip
return if orgname.empty?

name = ORGNAMES[orgname] || orgname
{ entity: new_org(name, org[:abbrev]), role: [contributor_role(contrib)] }
# end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/relaton_bib/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module RelatonBib
VERSION = "1.12.3".freeze
VERSION = "1.12.4".freeze
end
17 changes: 17 additions & 0 deletions spec/relaton_bib/bibxml_parser_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,23 @@
expect(RelatonBib::BibXMLParser.month("Sept")).to eq "09"
end

it "skip empty organization" do
bibxml = <<~END_XML
<reference anchor="RFC0001" target="https://www.rfc-editor.org/info/rfc1">
<front>
<title>Host Software</title>
<author>
<organization>
</organization>
</author>
<seriesInfo name="RFC" value="1"/>
</front>
</reference>
END_XML
rfc = RelatonBib::BibXMLParser.parse bibxml
expect(rfc.contributor).to be_empty
end

# it "returns default affiliation" do
# doc = Nokogiri::XML <<~END_XML
# <reference>
Expand Down

0 comments on commit 36fcdb8

Please sign in to comment.