Sha256: 5596735cc4419127a73c81202e23a800089524bde827b885332e5fa7cff65277

Contents?: true

Size: 823 Bytes

Versions: 6

Compression:

Stored size: 823 Bytes

Contents

module Coradoc
  module Parser
    module Asciidoc
      module Table
        # include Coradoc::Parser::Asciidoc::Base

        def table
          block_id.maybe >>
          (attribute_list >> newline).maybe >>
          block_title.maybe >>
          (attribute_list >> newline).maybe >>
            str("|===") >> line_ending >>
            table_row.repeat(1).as(:rows) >>
            str("|===") >> line_ending
        end

        def table_row
          (literal_space? >> str("|") >> (cell_content | empty_cell_content))
            .repeat(1).as(:cols) >> line_ending
        end

        def empty_cell_content
          str("|").absent? >> literal_space.as(:text)
        end

        def cell_content
          str("|").absent? >> literal_space? >> rich_texts.as(:text)
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
coradoc-1.1.6 lib/coradoc/parser/asciidoc/table.rb
coradoc-1.1.5 lib/coradoc/parser/asciidoc/table.rb
coradoc-1.1.4 lib/coradoc/parser/asciidoc/table.rb
coradoc-1.1.3 lib/coradoc/parser/asciidoc/table.rb
coradoc-1.1.2 lib/coradoc/parser/asciidoc/table.rb
coradoc-1.1.1 lib/coradoc/parser/asciidoc/table.rb