diff --git a/features/names.feature b/features/names.feature index 87f6de7..5c3fb6b 100644 --- a/features/names.feature +++ b/features/names.feature @@ -50,3 +50,18 @@ Feature: CSL Name Rendering Then the results should be: | COLE, S. J.; MOORE, R. | + + Scenario: Name as sort order + Given the following style node: + """ + + + + """ + When I render the following citation items as "html": + | author | + | John Doe | + | John Doe and Jane Doe | + Then the results should be: + | Doe, John | + | Doe, John, and Jane Doe | diff --git a/lib/citeproc/ruby/renderer/layout.rb b/lib/citeproc/ruby/renderer/layout.rb index 92dc503..728e569 100644 --- a/lib/citeproc/ruby/renderer/layout.rb +++ b/lib/citeproc/ruby/renderer/layout.rb @@ -9,9 +9,9 @@ class Renderer # @param node [CSL::Style::Layout] # @return [String] def render_layout(item, node) - node.each_child.map { |child| + join node.each_child.map { |child| render item, child - }.reject(&:empty?).join(node.delimiter) + }.reject(&:empty?), node.delimiter end end