Sha256: 3777b3cce649b157b001112f50b9a16d15f1029b41d9dc7c377bc4a236846ed6

Contents?: true

Size: 852 Bytes

Versions: 14

Compression:

Stored size: 852 Bytes

Contents

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

require 'kramdown/parser/kramdown/extensions'
require 'kramdown/parser/kramdown/blank_line'
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

14 entries across 13 versions & 5 rubygems

Version Path
able-neo4j-1.0.0 vendor/bundle/jruby/1.9/gems/kramdown-1.8.0/lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-1.10.0 lib/kramdown/parser/kramdown/block_boundary.rb
angular-rails4-templates-0.4.1 vendor/ruby/2.1.0/gems/kramdown-1.8.0/lib/kramdown/parser/kramdown/block_boundary.rb
angular-rails4-templates-0.4.0 vendor/ruby/2.1.0/gems/kramdown-1.8.0/lib/kramdown/parser/kramdown/block_boundary.rb
angular-rails4-templates-0.3.0 vendor/ruby/2.1.0/gems/kramdown-1.8.0/lib/kramdown/parser/kramdown/block_boundary.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/kramdown-1.9.0/lib/kramdown/parser/kramdown/block_boundary.rb
logstash-input-beats-2.0.2 vendor/jruby/1.9/gems/logstash-codec-json-2.0.3/vendor/gems/kramdown-1.9.0/lib/kramdown/parser/kramdown/block_boundary.rb
logstash-codec-json-2.0.3 vendor/gems/kramdown-1.9.0/lib/kramdown/parser/kramdown/block_boundary.rb
logstash-input-beats-0.9.2 vendor/jruby/1.9/gems/kramdown-1.9.0/lib/kramdown/parser/kramdown/block_boundary.rb
logstash-input-beats-0.9.1 vendor/jruby/1.9/gems/kramdown-1.9.0/lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-1.9.0 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-1.8.0 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-1.7.0 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-1.6.0 lib/kramdown/parser/kramdown/block_boundary.rb