Sha256: a8d3d7901b8195e6288c4c8958fa4397876844af0fddfdf5438be4f74033eaad

Contents?: true

Size: 1.03 KB

Versions: 75

Compression:

Stored size: 1.03 KB

Contents

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

require 'kramdown/parser/html'

module Kramdown
  module Parser
    class Kramdown

      # Parse the HTML entity at the current location.
      def parse_html_entity
        start_line_number = @src.current_line_number
        @src.pos += @src.matched_size
        begin
          @tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity(@src[1] || (@src[2] && @src[2].to_i) || @src[3].hex),
                                        nil, :original => @src.matched, :location => start_line_number)
        rescue ::Kramdown::Error
          @tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('amp'),
                                        nil, :location => start_line_number)
          add_text(@src.matched[1..-1])
        end
      end
      define_parser(:html_entity, Kramdown::Parser::Html::Constants::HTML_ENTITY_RE, '&')

    end
  end
end

Version data entries

75 entries across 72 versions & 18 rubygems

Version Path
logstash-output-scalyr-0.2.1.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.2.0 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.2.0.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.26.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.25.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.24.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.23.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.22.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.21.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.20.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.19.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.18.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.17.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.16.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.15.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.14.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.13 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.12 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.11.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb
logstash-output-scalyr-0.1.10.beta vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/html_entity.rb