class Kramdown::Parser::Kramdown
def parse_spans(el, stop_re = nil, parsers = nil, text_type = @text_type)
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 && (stop_re_matched = @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.scan(/./)) if !processed && !stop_re_found else add_text(@src.scan(/.*/m)) unless stop_re break end end @tree, @text_type = @stack.pop stop_re_found end