.bundle/ruby/2.0.0/gems/kramdown-1.4.1/lib/kramdown/parser/kramdown.rb
# Parse all span-level elements in the source string of @src into +el+.
#
# If the parameter +stop_re+ (a regexp) is used, parsing is immediately stopped if the regexp
# matches and if no block is given or if a block is given and it returns +true+.
#
# The parameter +parsers+ can be used to specify the (span-level) parsing methods that should
# be used for parsing.
#
# The parameter +text_type+ specifies the type which should be used for created text nodes.
Parse all span-level elements in the source string of @src into +el+.
If the parameter +stop_re+ (a regexp) is used, parsing is immediately stopped if the regexp
matches and if no block is given or if a block is given and it returns +true+.

The parameter +parsers+ can be used to specify the (span-level) parsing methods that should
be used for parsing.

The parameter +text_type+ specifies the type which should be used for created text nodes.
Parse all span - level elements in the source string of @src into + el + . If the parameter + stop_re + ( a regexp ) is used parsing is immediately stopped if the regexp matches and if no block is given or if a block is given and it returns + true + . The parameter + parsers + can be used to specify the ( span - level ) parsing methods that should be used for parsing . The parameter + text_type + specifies the type which should be used for created text nodes .
def parse_spans(el, stop_re = nil, parsers = nil, text_type = @text_type)
        @stack.push([@tree, @text_type]) unless @tree.nil?
        @tree, @text_type = el, text_type
        span_start = @span_start
        span_start_re = @span_start_re
        span_start, span_start_re = span_parser_regexps(parsers) if parsers
        parsers = parsers || @span_parsers
        used_re = (stop_re.nil? ? span_start_re : /(?=#{Regexp.union(stop_re, span_start)})/)
        stop_re_found = false
        while !@src.eos? && !stop_re_found
          if result = @src.scan_until(used_re)
            add_text(result)
            if stop_re && @src.check(stop_re)
              stop_re_found = (block_given? ? yield : true)
            end
            processed = parsers.any? do |name|
              if @src.check(@parsers[name].start_re)
                send(@parsers[name].method)
                true
              else
                false
              end
            end unless stop_re_found
            add_text(@src.getch) if !processed && !stop_re_found
          else
            (add_text(@src.rest); @src.terminate) unless stop_re
            break
          end
        end
        @tree, @text_type = @stack.pop
        stop_re_found
      end
def parse_spans ( el , stop_re = nil , parsers = nil , text_type = @text_type ) @stack . push ( [ @tree , @text_type ] ) unless @tree . nil? @tree , @text_type = el , text_type span_start = @span_start span_start_re = @span_start_re span_start , span_start_re = span_parser_regexps ( parsers ) if parsers parsers = parsers || @span_parsers used_re = ( stop_re . nil? ? span_start_re : / (?= #{ Regexp . union ( stop_re , span_start ) } ) / ) stop_re_found = false while ! @src . eos? && ! stop_re_found if result = @src . scan_until ( used_re ) add_text ( result ) if stop_re && @src . check ( stop_re ) stop_re_found = ( block_given? ? yield : true ) end processed = parsers . any? do | name | if @src . check ( @parsers [ name ] . start_re ) send ( @parsers [ name ] . method ) true else false end end unless stop_re_found add_text ( @src . getch ) if ! processed && ! stop_re_found else ( add_text ( @src . rest ) ; @src . terminate ) unless stop_re break end end @tree , @text_type = @stack . pop stop_re_found end
Parse all span-level elements in the source string of @src into +el+.
Parse all span - level elements in the source string of @src into + el + .
el
stop_re
parsers
text_type