Sha256: 68324a794a9defbf6426b49ed6a7f1891a6729af7d7936b9c9f65acaab201f06

Contents?: true

Size: 695 Bytes

Versions: 3

Compression:

Stored size: 695 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.
#++
#

module Kramdown
  module Parser
    class Kramdown

      BLANK_LINE = /(?>^\s*\n)+/

      # Parse the blank line at the current postition.
      def parse_blank_line
        @src.pos += @src.matched_size
        if @tree.children.last && @tree.children.last.type == :blank
          @tree.children.last.value << @src.matched
        else
          @tree.children << new_block_el(:blank, @src.matched)
        end
        true
      end
      define_parser(:blank_line, BLANK_LINE)

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kramdown-2.0.0 lib/kramdown/parser/kramdown/blank_line.rb
kramdown-2.0.0.beta2 lib/kramdown/parser/kramdown/blank_line.rb
kramdown-2.0.0.beta1 lib/kramdown/parser/kramdown/blank_line.rb