lib/polites/parser.rb
# Parse just the markup section of a sheet into a {Markup} container.
#
# @param [Nokogiri::Node] element
# @return [Markup]
Parse just the markup section of a sheet into a {Markup} container.
Parse just the markup section of a sheet into a { Markup } container .
def parse_markup(element)
      markup = element.xpath('markup').first
      tags = markup.xpath('tag').map do |e|
        if e[:pattern]
          SimpleTag.new(e[:definition], e[:pattern])
        elsif e[:startPattern] && e[:endPattern]
          RangeTag.new(e[:definition], e[:startPattern], e[:endPattern])
        end
      end
      Markup.new(markup[:version], markup[:identifier], markup[:displayName], tags)
    end
def parse_markup ( element ) markup = element . xpath ( 'markup' ) . first tags = markup . xpath ( 'tag' ) . map do | e | if e [ :pattern ] SimpleTag . new ( e [ :definition ] , e [ :pattern ] ) elsif e [ :startPattern ] && e [ :endPattern ] RangeTag . new ( e [ :definition ] , e [ :startPattern ] , e [ :endPattern ] ) end end Markup . new ( markup [ :version ] , markup [ :identifier ] , markup [ :displayName ] , tags ) end
Parse just the markup section of a sheet into a {Markup} container.
Parse just the markup section of a sheet into a { Markup } container .
None
Markup
element
<not_specific>
<not_specific>
None