Sha256: 177964b1c8d20866a949d3f90c203e231a18b76a587e86b774e7385fbad2797d

Contents?: true

Size: 984 Bytes

Versions: 17

Compression:

Stored size: 984 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/blank_line'
require 'kramdown/parser/kramdown/extensions'
require 'kramdown/parser/kramdown/eob'

module Kramdown
  module Parser
    class Kramdown

      BLOCKQUOTE_START = /^#{OPT_SPACE}> ?/

      # Parse the blockquote at the current location.
      def parse_blockquote
        start_line_number = @src.current_line_number
        result = @src.scan(PARAGRAPH_MATCH)
        until @src.match?(self.class::LAZY_END)
          result << @src.scan(PARAGRAPH_MATCH)
        end
        result.gsub!(BLOCKQUOTE_START, '')

        el = new_block_el(:blockquote, nil, nil, location: start_line_number)
        @tree.children << el
        parse_blocks(el, result)
        true
      end
      define_parser(:blockquote, BLOCKQUOTE_START)

    end
  end
end

Version data entries

17 entries across 17 versions & 4 rubygems

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