Sha256: 476113c87b60bbfc2408b09e5cb2b92f299d3755d2835c92a1e38ab8efff048d

Contents?: true

Size: 1 KB

Versions: 68

Compression:

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

module Kramdown
  module Parser
    class Kramdown

      if RUBY_VERSION == '1.8.5'
        ACHARS = '\w\x80-\xFF'
      elsif RUBY_VERSION < '1.9.0'
        ACHARS = '\w'
      else
        ACHARS = '[[:alnum:]]_'
      end
      AUTOLINK_START_STR = "<((mailto|https?|ftps?):.+?|[-.#{ACHARS}]+@[-#{ACHARS}]+(?:\.[-#{ACHARS}]+)*\.[a-z]+)>"
      AUTOLINK_START = /#{AUTOLINK_START_STR}/u

      # Parse the autolink at the current location.
      def parse_autolink
        start_line_number = @src.current_line_number
        @src.pos += @src.matched_size
        href = (@src[2].nil? ? "mailto:#{@src[1]}" : @src[1])
        el = Element.new(:a, nil, {'href' => href}, :location => start_line_number)
        add_text(@src[1].sub(/^mailto:/, ''), el)
        @tree.children << el
      end
      define_parser(:autolink, AUTOLINK_START, '<')

    end
  end
end

Version data entries

68 entries across 65 versions & 16 rubygems

Version Path
logstash-output-scalyr-0.1.9 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-scalyr-0.1.8 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-scalyr-0.1.7 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-scalyr-0.1.6 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-newrelic-1.2.0 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-csharp-0.2.1 vendor/bundle/jruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-csharp-0.2.0 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-scalyr-0.1.5 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-scalyr-0.1.4 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-scalyr-0.1.3 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-scalyr-0.1.2 vendor/bundle/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-device_detection-1.0.7-java vendor/bundle/jruby/1.9/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
mrcooper-logstash-output-azuresearch-0.2.2 vendor/jruby/2.5.0/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-icinga-1.1.0 vendor/jruby/2.3.0/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown/autolink.rb
logstash-output-icinga-1.1.0 vendor/jruby/1.9/gems/kramdown-1.13.2/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-cache-redis-0.3.1 vendor/bundle/jruby/1.9/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-cache-redis-0.3.0 vendor/bundle/jruby/1.9/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb
logstash-filter-cache-redis-0.2.0 vendor/bundle/jruby/1.9/gems/kramdown-1.14.0/lib/kramdown/parser/kramdown/autolink.rb