module Rouge::Indentation
def indentation(indent_str)
def indentation(indent_str) puts " indentation: #{indent_str.inspect}" if @debug puts " block_indentation: #{@block_indentation.inspect}" if @debug @last_indentation = indent_str # if it's an indent and we know where to go next, # push that state. otherwise, push content and # clear the block state. if (@block_state && indent_str.start_with?(@block_indentation) && indent_str != @block_indentation ) push @block_state else @block_state = @block_indentation = nil push :content end end
def reset!
def reset! super @block_state = @block_indentation = nil end
def starts_block(block_state)
def starts_block(block_state) @block_state = block_state @block_indentation = @last_indentation || '' puts " starts_block: #{block_state.inspect}" if @debug puts " block_indentation: #{@block_indentation.inspect}" if @debug end