Sha256: 6b5ffb45b787a54b4b53825a9b28d34e9fe1d43e08c03d3db746644d40ea38b5

Contents?: true

Size: 886 Bytes

Versions: 14

Compression:

Stored size: 886 Bytes

Contents

# -*- coding: utf-8; frozen_string_literal: true -*-
#
#--
# Copyright (C) 2009-2019 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?
        last_child = @tree.children.last
        !last_child || last_child.type == :blank ||
          (last_child.type == :eob && last_child.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 14 versions & 4 rubygems

Version Path
kramdown-2.5.1 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.5.0 lib/kramdown/parser/kramdown/block_boundary.rb
getargv-0.3.3-universal-darwin vendor/bundle/ruby/3.3.0/gems/kramdown-2.4.0/lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.4.0 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.3.2 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.3.1 lib/kramdown/parser/kramdown/block_boundary.rb
daqing_kramdown-2.3.2 lib/kramdown/parser/kramdown/block_boundary.rb
daqing_kramdown-2.3.1 lib/kramdown/parser/kramdown/block_boundary.rb
zine_brewer-1.5.0 vendor/bundle/ruby/2.7.0/gems/kramdown-2.3.0/lib/kramdown/parser/kramdown/block_boundary.rb
zine_brewer-1.3.0 vendor/bundle/ruby/2.7.0/gems/kramdown-2.3.0/lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.3.0 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.2.1 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.2.0 lib/kramdown/parser/kramdown/block_boundary.rb
kramdown-2.1.0 lib/kramdown/parser/kramdown/block_boundary.rb