Sha256: b1e21bd7b3f33a4eb399578d0e2adfec85895f9f55e94a0ff6383b6b7369090e

Contents?: true

Size: 867 Bytes

Versions: 2

Compression:

Stored size: 867 Bytes

Contents

# -*- coding: utf-8 -*-
#
#--
# Copyright (C) 2009-2014 Thomas Leitner <t_leitner@gmx.at>
#
# This file is part of kramdown which is licensed under the MIT.
#++
#

# RM require 'kramdown/parser/kramdown/extensions'
# RM require 'kramdown/parser/kramdown/blank_line'
# RM require 'kramdown/parser/kramdown/eob'

module Kramdown
  module Parser
    class Kramdown

      BLOCK_BOUNDARY = /#{BLANK_LINE}|#{EOB_MARKER}|#{IAL_BLOCK_START}|\Z/

      # Return +true+ if we are after a block boundary.
      def after_block_boundary?
        !@tree.children.last || @tree.children.last.type == :blank ||
          (@tree.children.last.type == :eob && @tree.children.last.value.nil?) || @block_ial
      end

      # Return +true+ if we are before a block boundary.
      def before_block_boundary?
        @src.check(self.class::BLOCK_BOUNDARY)
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
motion-kramdown-0.5.1 lib/kramdown/parser/kramdown/block_boundary.rb
motion-kramdown-0.5.0 lib/kramdown/parser/kramdown/block_boundary.rb