mdc/lib/parsing/parser_handler.rb
##
# Lookahead for the special case of empty lines inside a source
# section (goes beyond Markdown standard)
# @param [ParserState] ps State of the parser
# @param [Array] lines Lines of input
Lookahead for the special case of empty lines inside a source
section (goes beyond Markdown standard)
Lookahead for the special case of empty lines inside a source section ( goes beyond Markdown standard )
def source_lookahead(ps, lines)
      no_more_source = true
      i = ps.line_counter
      while i < lines.length
        peek_line = MarkdownLine.new(lines[i])
        if peek_line.source?
          no_more_source = false
          break
        elsif peek_line.normal?
          break
        end
        i += 1
      end
      if no_more_source
        ps.normal!
      else
        element(ps) << "\n"
      end
    end
def source_lookahead ( ps , lines ) no_more_source = true i = ps . line_counter while i < lines . length peek_line = MarkdownLine . new ( lines [ i ] ) if peek_line . source? no_more_source = false break elsif peek_line . normal? break end i += 1 end if no_more_source ps . normal! else element ( ps ) << "\n" end end
Lookahead for the special case of empty lines inside a source
section (goes beyond Markdown standard)
Lookahead for the special case of empty lines inside a source section ( goes beyond Markdown standard )
ps
<not_specific>
lines
<not_specific>
<not_specific>
lines Lines of input
lines Lines of input