lib/metanorma/ogc/front.rb in metanorma-ogc-2.0.1 vs lib/metanorma/ogc/front.rb in metanorma-ogc-2.0.2

- old
+ new

@@ -34,10 +34,22 @@ personal_author1(node, xml, "_#{i}") i += 1 end end + def personal_role(node, contrib, suffix) + type = node.attr("role#{suffix}")&.downcase || "editor" + if type == "contributor" + contrib.role **{ type: "author" } do |r| + r.description do |d| + d << type + end + end + else contrib.role **{ type: type } + end + end + def ogc_editor(node, xml) return unless node.attr("editor") xml.contributor do |c| c.role **{ type: "editor" } @@ -49,10 +61,10 @@ end end def personal_author1(node, xml, suffix) xml.contributor do |c| - c.role **{ type: node&.attr("role#{suffix}")&.downcase || "editor" } + personal_role(node, c, suffix) c.person do |p| p.name do |n| if node.attr("fullname#{suffix}") n.completename node.attr("fullname#{suffix}") else