Sha256: 17e543e4d3a318fd56a3426c90eec89f8fc911003def12cccfa5f5febc649b82

Contents?: true

Size: 631 Bytes

Versions: 24

Compression:

Stored size: 631 Bytes

Contents

module CiteProc
  module Ruby

    class Renderer

      # @param item [CiteProc::CitationItem]
      # @param node [CSL::Style::Group]
      # @return [String]
      def render_group(item, node)
        return '' unless node.has_children?

        observer = ItemObserver.new(item.data)
        observer.start

        begin
          rendition = node.each_child.map { |child|
            render item, child
          }.reject(&:empty?)

          rendition = join(rendition, node.delimiter)

        ensure
          observer.stop
        end

        return '' if observer.skip?

        rendition
      end

    end

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
citeproc-ruby-1.0.3 lib/citeproc/ruby/renderer/group.rb
citeproc-ruby-1.0.2 lib/citeproc/ruby/renderer/group.rb
citeproc-ruby-1.0.1 lib/citeproc/ruby/renderer/group.rb
citeproc-ruby-1.0.0 lib/citeproc/ruby/renderer/group.rb