kramdown 1.14.0 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kramdown might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CONTRIBUTERS +1 -1
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/doc/index.page +2 -2
- data/doc/syntax.page +4 -0
- data/lib/kramdown/converter/html.rb +20 -4
- data/lib/kramdown/converter/latex.rb +6 -4
- data/lib/kramdown/document.rb +1 -4
- data/lib/kramdown/parser/base.rb +9 -15
- data/lib/kramdown/parser/kramdown.rb +4 -1
- data/lib/kramdown/parser/kramdown/autolink.rb +1 -7
- data/lib/kramdown/utils/html.rb +1 -1
- data/lib/kramdown/utils/ordered_hash.rb +1 -75
- data/lib/kramdown/utils/unidecoder.rb +1 -1
- data/lib/kramdown/version.rb +1 -1
- data/test/testcases/block/06_codeblock/rouge/multiple.html +6 -6
- data/test/testcases/block/06_codeblock/rouge/simple.html +6 -6
- data/test/testcases/block/08_list/brackets_in_item.latex +3 -0
- data/test/testcases/block/08_list/brackets_in_item.text +1 -0
- data/test/testcases/block/12_extension/options.html +1 -1
- data/test/testcases/block/12_extension/options2.html +1 -1
- data/test/testcases/block/16_toc/toc_with_footnotes.html +1 -1
- data/test/testcases/block/16_toc/toc_with_links.html +8 -0
- data/test/testcases/block/16_toc/toc_with_links.options +2 -0
- data/test/testcases/block/16_toc/toc_with_links.text +8 -0
- data/test/testcases/span/01_link/latex_escaping.latex +6 -0
- data/test/testcases/span/01_link/latex_escaping.text +5 -0
- data/test/testcases/span/04_footnote/backlink_text.html +1 -1
- data/test/testcases/span/04_footnote/definitions.latex +2 -2
- data/test/testcases/span/04_footnote/footnote_nr.html +2 -2
- data/test/testcases/span/04_footnote/inside_footnote.html +3 -3
- data/test/testcases/span/04_footnote/markers.latex +2 -2
- data/test/testcases/span/04_footnote/markers.options +2 -0
- data/test/testcases/span/04_footnote/placement.html +1 -1
- data/test/testcases/span/04_footnote/placement.options +1 -0
- data/test/testcases/span/04_footnote/regexp_problem.options +2 -0
- data/test/testcases/span/abbreviations/in_footnote.html +9 -0
- data/test/testcases/span/abbreviations/in_footnote.text +5 -0
- metadata +19 -8
- data/lib/kramdown/compatibility.rb +0 -48
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 69c006f3143fcd067cb7c1a27f80baf39870e3e7
         | 
| 4 | 
            +
              data.tar.gz: 88ae530383c5a4cacf7791cfb8c451a2fac49355
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 603752731df3717905665935bd5b3e412943a09de2b5d776f18d6fe1cecca18e210541e81c7863f43a42b469e2a3e5e232b4bce43671abdbfa9a557f01eb78e5
         | 
| 7 | 
            +
              data.tar.gz: 8d62fd7e8905d385fb1d269b03f09abb237e8953830d1e01e7ee5e56b10ec796a47fd03c7ac7c3d87dbcdfe4cfc11a2bbf3f04bef1c25b3a5d5b17aa0ae70048
         | 
    
        data/CONTRIBUTERS
    CHANGED
    
    
    
        data/Rakefile
    CHANGED
    
    | @@ -176,9 +176,10 @@ EOF | |
| 176 176 | 
             
                  s.require_path = 'lib'
         | 
| 177 177 | 
             
                  s.executables = ['kramdown']
         | 
| 178 178 | 
             
                  s.default_executable = 'kramdown'
         | 
| 179 | 
            +
                  s.required_ruby_version = '>= 2.0'
         | 
| 179 180 | 
             
                  s.add_development_dependency 'minitest', '~> 5.0'
         | 
| 180 181 | 
             
                  s.add_development_dependency 'coderay', '~> 1.0.0'
         | 
| 181 | 
            -
                  s.add_development_dependency 'rouge' | 
| 182 | 
            +
                  s.add_development_dependency 'rouge'
         | 
| 182 183 | 
             
                  s.add_development_dependency 'stringex', '~> 1.5.1'
         | 
| 183 184 | 
             
                  s.add_development_dependency 'prawn', '~> 2.0'
         | 
| 184 185 | 
             
                  s.add_development_dependency 'prawn-table', '~> 0.2.2'
         | 
    
        data/VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1. | 
| 1 | 
            +
            1.15.0
         | 
    
        data/doc/index.page
    CHANGED
    
    | @@ -97,8 +97,8 @@ extensions that have been made popular by the [PHP Markdown Extra] package and [ | |
| 97 97 | 
             
            It is probably the fastest pure-Ruby Markdown converter available (September 2014), being about 3x
         | 
| 98 98 | 
             
            faster than [Maruku] and about 4.5x faster than [BlueFeather].
         | 
| 99 99 |  | 
| 100 | 
            -
            Version **1. | 
| 101 | 
            -
            **2017- | 
| 100 | 
            +
            Version **1.15.0**{:itemprop="softwareVersion"} released on
         | 
| 101 | 
            +
            **2017-09-08**{:itemprop="datePublished"}, [more news](news.html)
         | 
| 102 102 | 
             
            {: style="text-align: center; font-size: 80%"}
         | 
| 103 103 |  | 
| 104 104 | 
             
            </div>
         | 
    
        data/doc/syntax.page
    CHANGED
    
    | @@ -1435,6 +1435,10 @@ optionally followed by other word characters, digits or dashes. For example: | |
| 1435 1435 |  | 
| 1436 1436 | 
             
                This is some text.[^1]. Other text.[^footnote].
         | 
| 1437 1437 |  | 
| 1438 | 
            +
            > Note that footnote markers cannot be used as part of the link text of a link because this would
         | 
| 1439 | 
            +
            > lead to nested links which is not allowed in HTML.
         | 
| 1440 | 
            +
            {: .information}
         | 
| 1441 | 
            +
             | 
| 1438 1442 | 
             
            Footnote markers with the same name will link to the same footnote definition. The actual naming of
         | 
| 1439 1443 | 
             
            a footnote does not matter since the numbering of footnotes is controlled via the position of the
         | 
| 1440 1444 | 
             
            footnote markers in the document (the first found footnote marker will get the number 1, the second 
         | 
| @@ -386,7 +386,7 @@ module Kramdown | |
| 386 386 | 
             
                      a = Element.new(:a, nil)
         | 
| 387 387 | 
             
                      a.attr['href'] = "##{id}"
         | 
| 388 388 | 
             
                      a.attr['id'] = "#{sections.attr['id']}-#{id}"
         | 
| 389 | 
            -
                      a.children.concat( | 
| 389 | 
            +
                      a.children.concat(fix_for_toc_entry(Marshal.load(Marshal.dump(children))))
         | 
| 390 390 | 
             
                      li.children.last.children << a
         | 
| 391 391 | 
             
                      li.children << Element.new(type)
         | 
| 392 392 |  | 
| @@ -413,6 +413,21 @@ module Kramdown | |
| 413 413 | 
             
                    sections
         | 
| 414 414 | 
             
                  end
         | 
| 415 415 |  | 
| 416 | 
            +
                  # Fixes the elements for use in a TOC entry.
         | 
| 417 | 
            +
                  def fix_for_toc_entry(elements)
         | 
| 418 | 
            +
                    remove_footnotes(elements)
         | 
| 419 | 
            +
                    unwrap_links(elements)
         | 
| 420 | 
            +
                    elements
         | 
| 421 | 
            +
                  end
         | 
| 422 | 
            +
             | 
| 423 | 
            +
                  # Remove all link elements by unwrapping them.
         | 
| 424 | 
            +
                  def unwrap_links(elements)
         | 
| 425 | 
            +
                    elements.map! do |c|
         | 
| 426 | 
            +
                      unwrap_links(c.children)
         | 
| 427 | 
            +
                      c.type == :a ? c.children : c
         | 
| 428 | 
            +
                    end.flatten!
         | 
| 429 | 
            +
                  end
         | 
| 430 | 
            +
             | 
| 416 431 | 
             
                  # Remove all footnotes from the given elements.
         | 
| 417 432 | 
             
                  def remove_footnotes(elements)
         | 
| 418 433 | 
             
                    elements.delete_if do |c|
         | 
| @@ -427,7 +442,7 @@ module Kramdown | |
| 427 442 | 
             
                    text.each_byte do |b|
         | 
| 428 443 | 
             
                      result << (b > 128 ? b.chr : "&#%03d;" % b)
         | 
| 429 444 | 
             
                    end
         | 
| 430 | 
            -
                    result.force_encoding(text.encoding) | 
| 445 | 
            +
                    result.force_encoding(text.encoding)
         | 
| 431 446 | 
             
                    result
         | 
| 432 447 | 
             
                  end
         | 
| 433 448 |  | 
| @@ -453,9 +468,10 @@ module Kramdown | |
| 453 468 | 
             
                      end
         | 
| 454 469 |  | 
| 455 470 | 
             
                      unless @options[:footnote_backlink].empty?
         | 
| 456 | 
            -
                         | 
| 471 | 
            +
                        nbsp = entity_to_str(ENTITY_NBSP)
         | 
| 472 | 
            +
                        para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [insert_space ? nbsp : '', name, backlink_text])
         | 
| 457 473 | 
             
                        (1..repeat).each do |index|
         | 
| 458 | 
            -
                          para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [ | 
| 474 | 
            +
                          para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [nbsp, "#{name}:#{index}", "#{backlink_text}<sup>#{index+1}</sup>"])
         | 
| 459 475 | 
             
                        end
         | 
| 460 476 | 
             
                      end
         | 
| 461 477 |  | 
| @@ -137,7 +137,7 @@ module Kramdown | |
| 137 137 | 
             
                  end
         | 
| 138 138 |  | 
| 139 139 | 
             
                  def convert_li(el, opts)
         | 
| 140 | 
            -
                    "\\item #{latex_link_target(el, true)}#{inner(el, opts).sub(/\n+\Z/, '')}\n"
         | 
| 140 | 
            +
                    "\\item{} #{latex_link_target(el, true)}#{inner(el, opts).sub(/\n+\Z/, '')}\n"
         | 
| 141 141 | 
             
                  end
         | 
| 142 142 |  | 
| 143 143 | 
             
                  def convert_dt(el, opts)
         | 
| @@ -210,9 +210,9 @@ module Kramdown | |
| 210 210 | 
             
                  def convert_a(el, opts)
         | 
| 211 211 | 
             
                    url = el.attr['href']
         | 
| 212 212 | 
             
                    if url.start_with?('#')
         | 
| 213 | 
            -
                      "\\hyperlink{#{ | 
| 213 | 
            +
                      "\\hyperlink{#{url[1..-1].gsub('%', "\\%")}}{#{inner(el, opts)}}"
         | 
| 214 214 | 
             
                    else
         | 
| 215 | 
            -
                      "\\href{#{ | 
| 215 | 
            +
                      "\\href{#{url.gsub('%', "\\%")}}{#{inner(el, opts)}}"
         | 
| 216 216 | 
             
                    end
         | 
| 217 217 | 
             
                  end
         | 
| 218 218 |  | 
| @@ -598,7 +598,9 @@ module Kramdown | |
| 598 598 | 
             
                    "~"  => "\\ensuremath{\\sim}",
         | 
| 599 599 | 
             
                    "|"  => "\\textbar{}",
         | 
| 600 600 | 
             
                    "<"  => "\\textless{}",
         | 
| 601 | 
            -
                    ">"  => "\\textgreater{}"
         | 
| 601 | 
            +
                    ">"  => "\\textgreater{}",
         | 
| 602 | 
            +
                    "["  => "{[}",
         | 
| 603 | 
            +
                    "]"  => "{]}",
         | 
| 602 604 | 
             
                  }.merge(Hash[*("{}$%&_#".scan(/./).map {|c| [c, "\\#{c}"]}.flatten)]) # :nodoc:
         | 
| 603 605 | 
             
                  ESCAPE_RE = Regexp.union(*ESCAPE_MAP.collect {|k,v| k}) # :nodoc:
         | 
| 604 606 |  | 
    
        data/lib/kramdown/document.rb
    CHANGED
    
    | @@ -35,9 +35,6 @@ | |
| 35 35 | 
             
            #
         | 
| 36 36 | 
             
            # MIT - see the COPYING file.
         | 
| 37 37 |  | 
| 38 | 
            -
             | 
| 39 | 
            -
            require 'kramdown/compatibility'
         | 
| 40 | 
            -
             | 
| 41 38 | 
             
            require 'kramdown/version'
         | 
| 42 39 | 
             
            require 'kramdown/element'
         | 
| 43 40 | 
             
            require 'kramdown/error'
         | 
| @@ -53,7 +50,7 @@ module Kramdown | |
| 53 50 | 
             
                unless defined?(@@data_dir)
         | 
| 54 51 | 
             
                  require 'rbconfig'
         | 
| 55 52 | 
             
                  @@data_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'data', 'kramdown'))
         | 
| 56 | 
            -
                  @@data_dir = File.expand_path(File.join(RbConfig::CONFIG["datadir"], "kramdown")) if !File. | 
| 53 | 
            +
                  @@data_dir = File.expand_path(File.join(RbConfig::CONFIG["datadir"], "kramdown")) if !File.exist?(@@data_dir)
         | 
| 57 54 | 
             
                  raise "kramdown data directory not found! This is a bug, please report it!" unless File.directory?(@@data_dir)
         | 
| 58 55 | 
             
                end
         | 
| 59 56 | 
             
                @@data_dir
         | 
    
        data/lib/kramdown/parser/base.rb
    CHANGED
    
    | @@ -89,12 +89,10 @@ module Kramdown | |
| 89 89 | 
             
                  # Modify the string +source+ to be usable by the parser (unifies line ending characters to
         | 
| 90 90 | 
             
                  # +\n+ and makes sure +source+ ends with a new line character).
         | 
| 91 91 | 
             
                  def adapt_source(source)
         | 
| 92 | 
            -
                     | 
| 93 | 
            -
                       | 
| 94 | 
            -
                        raise "The source text contains invalid characters for the used encoding #{source.encoding}"
         | 
| 95 | 
            -
                      end
         | 
| 96 | 
            -
                      source = source.encode('UTF-8')
         | 
| 92 | 
            +
                    unless source.valid_encoding?
         | 
| 93 | 
            +
                      raise "The source text contains invalid characters for the used encoding #{source.encoding}"
         | 
| 97 94 | 
             
                    end
         | 
| 95 | 
            +
                    source = source.encode('UTF-8')
         | 
| 98 96 | 
             
                    source.gsub(/\r\n?/, "\n").chomp + "\n"
         | 
| 99 97 | 
             
                  end
         | 
| 100 98 |  | 
| @@ -113,16 +111,12 @@ module Kramdown | |
| 113 111 | 
             
                  # method works correctly under Ruby 1.8 and Ruby 1.9.
         | 
| 114 112 | 
             
                  def extract_string(range, strscan)
         | 
| 115 113 | 
             
                    result = nil
         | 
| 116 | 
            -
                     | 
| 117 | 
            -
                       | 
| 118 | 
            -
             | 
| 119 | 
            -
             | 
| 120 | 
            -
             | 
| 121 | 
            -
                       | 
| 122 | 
            -
                        strscan.string.force_encoding(enc)
         | 
| 123 | 
            -
                      end
         | 
| 124 | 
            -
                    else
         | 
| 125 | 
            -
                      result = strscan.string[range]
         | 
| 114 | 
            +
                    begin
         | 
| 115 | 
            +
                      enc = strscan.string.encoding
         | 
| 116 | 
            +
                      strscan.string.force_encoding('ASCII-8BIT')
         | 
| 117 | 
            +
                      result = strscan.string[range].force_encoding(enc)
         | 
| 118 | 
            +
                    ensure
         | 
| 119 | 
            +
                      strscan.string.force_encoding(enc)
         | 
| 126 120 | 
             
                    end
         | 
| 127 121 | 
             
                    result
         | 
| 128 122 | 
             
                  end
         | 
| @@ -90,7 +90,10 @@ module Kramdown | |
| 90 90 | 
             
                    update_tree(@root)
         | 
| 91 91 | 
             
                    correct_abbreviations_attributes
         | 
| 92 92 | 
             
                    replace_abbreviations(@root)
         | 
| 93 | 
            -
                    @footnotes.each  | 
| 93 | 
            +
                    @footnotes.each do |name,data|
         | 
| 94 | 
            +
                      update_tree(data[:content])
         | 
| 95 | 
            +
                      replace_abbreviations(data[:content])
         | 
| 96 | 
            +
                    end
         | 
| 94 97 | 
             
                    @footnotes.each do |name, data|
         | 
| 95 98 | 
             
                      next if data.key?(:marker)
         | 
| 96 99 | 
             
                      line = data[:content].options[:location]
         | 
| @@ -11,13 +11,7 @@ module Kramdown | |
| 11 11 | 
             
              module Parser
         | 
| 12 12 | 
             
                class Kramdown
         | 
| 13 13 |  | 
| 14 | 
            -
                   | 
| 15 | 
            -
                    ACHARS = '\w\x80-\xFF'
         | 
| 16 | 
            -
                  elsif RUBY_VERSION < '1.9.0'
         | 
| 17 | 
            -
                    ACHARS = '\w'
         | 
| 18 | 
            -
                  else
         | 
| 19 | 
            -
                    ACHARS = '[[:alnum:]]_'
         | 
| 20 | 
            -
                  end
         | 
| 14 | 
            +
                  ACHARS = '[[:alnum:]]_'
         | 
| 21 15 | 
             
                  AUTOLINK_START_STR = "<((mailto|https?|ftps?):.+?|[-.#{ACHARS}]+@[-#{ACHARS}]+(?:\.[-#{ACHARS}]+)*\.[a-z]+)>"
         | 
| 22 16 | 
             
                  AUTOLINK_START = /#{AUTOLINK_START_STR}/u
         | 
| 23 17 |  | 
    
        data/lib/kramdown/utils/html.rb
    CHANGED
    
    | @@ -27,7 +27,7 @@ module Kramdown | |
| 27 27 | 
             
                  def entity_to_str(e, original = nil)
         | 
| 28 28 | 
             
                    entity_output = @options[:entity_output]
         | 
| 29 29 |  | 
| 30 | 
            -
                    if  | 
| 30 | 
            +
                    if entity_output == :as_char &&
         | 
| 31 31 | 
             
                        (c = e.char.encode(@root.options[:encoding]) rescue nil) &&
         | 
| 32 32 | 
             
                        ((c = e.char) == '"' || !ESCAPE_MAP.has_key?(c))
         | 
| 33 33 | 
             
                      c
         | 
| @@ -11,81 +11,7 @@ module Kramdown | |
| 11 11 |  | 
| 12 12 | 
             
              module Utils
         | 
| 13 13 |  | 
| 14 | 
            -
                 | 
| 15 | 
            -
             | 
| 16 | 
            -
                  # A partial hash implementation which preserves the insertion order of the keys.
         | 
| 17 | 
            -
                  #
         | 
| 18 | 
            -
                  # *Note* that this class is only used on Ruby 1.8 since the built-in Hash on Ruby 1.9
         | 
| 19 | 
            -
                  # automatically preserves the insertion order. However, to remain compatibility only the
         | 
| 20 | 
            -
                  # methods defined in this class may be used when working with OrderedHash on Ruby 1.9.
         | 
| 21 | 
            -
                  class OrderedHash
         | 
| 22 | 
            -
             | 
| 23 | 
            -
                    include Enumerable
         | 
| 24 | 
            -
             | 
| 25 | 
            -
                    # Initialize the OrderedHash object.
         | 
| 26 | 
            -
                    def initialize
         | 
| 27 | 
            -
                      @data =  {}
         | 
| 28 | 
            -
                      @order = []
         | 
| 29 | 
            -
                    end
         | 
| 30 | 
            -
             | 
| 31 | 
            -
                    # Iterate over the stored keys in insertion order.
         | 
| 32 | 
            -
                    def each
         | 
| 33 | 
            -
                      @order.each {|k| yield(k, @data[k])}
         | 
| 34 | 
            -
                    end
         | 
| 35 | 
            -
             | 
| 36 | 
            -
                    # Return the value for the +key+.
         | 
| 37 | 
            -
                    def [](key)
         | 
| 38 | 
            -
                      @data[key]
         | 
| 39 | 
            -
                    end
         | 
| 40 | 
            -
             | 
| 41 | 
            -
                    # Return +true+ if the hash contains the key.
         | 
| 42 | 
            -
                    def has_key?(key)
         | 
| 43 | 
            -
                      @data.has_key?(key)
         | 
| 44 | 
            -
                    end
         | 
| 45 | 
            -
             | 
| 46 | 
            -
                    # Return +true+ if the hash contains no keys.
         | 
| 47 | 
            -
                    def empty?
         | 
| 48 | 
            -
                      @data.empty?
         | 
| 49 | 
            -
                    end
         | 
| 50 | 
            -
             | 
| 51 | 
            -
                    # Set the value for the +key+ to +val+.
         | 
| 52 | 
            -
                    def []=(key, val)
         | 
| 53 | 
            -
                      @order << key if !@data.has_key?(key)
         | 
| 54 | 
            -
                      @data[key] = val
         | 
| 55 | 
            -
                    end
         | 
| 56 | 
            -
             | 
| 57 | 
            -
                    # Delete the +key+.
         | 
| 58 | 
            -
                    def delete(key)
         | 
| 59 | 
            -
                      @order.delete(key)
         | 
| 60 | 
            -
                      @data.delete(key)
         | 
| 61 | 
            -
                    end
         | 
| 62 | 
            -
             | 
| 63 | 
            -
                    def merge!(other)
         | 
| 64 | 
            -
                      other.each {|k,v| self[k] = v}
         | 
| 65 | 
            -
                      self
         | 
| 66 | 
            -
                    end
         | 
| 67 | 
            -
             | 
| 68 | 
            -
                    def dup #:nodoc:
         | 
| 69 | 
            -
                      new_object = super
         | 
| 70 | 
            -
                      new_object.instance_variable_set(:@data, @data.dup)
         | 
| 71 | 
            -
                      new_object.instance_variable_set(:@order, @order.dup)
         | 
| 72 | 
            -
                      new_object
         | 
| 73 | 
            -
                    end
         | 
| 74 | 
            -
             | 
| 75 | 
            -
                    def ==(other) #:nodoc:
         | 
| 76 | 
            -
                      return false unless other.kind_of?(self.class)
         | 
| 77 | 
            -
                      @data == other.instance_variable_get(:@data) && @order == other.instance_variable_get(:@order)
         | 
| 78 | 
            -
                    end
         | 
| 79 | 
            -
             | 
| 80 | 
            -
                    def inspect #:nodoc:
         | 
| 81 | 
            -
                      "{" + map {|k,v| "#{k.inspect}=>#{v.inspect}"}.join(" ") + "}"
         | 
| 82 | 
            -
                    end
         | 
| 83 | 
            -
             | 
| 84 | 
            -
                  end
         | 
| 85 | 
            -
             | 
| 86 | 
            -
                else
         | 
| 87 | 
            -
                  OrderedHash = Hash
         | 
| 88 | 
            -
                end
         | 
| 14 | 
            +
                OrderedHash = Hash
         | 
| 89 15 |  | 
| 90 16 | 
             
              end
         | 
| 91 17 |  | 
    
        data/lib/kramdown/version.rb
    CHANGED
    
    
| @@ -1,11 +1,11 @@ | |
| 1 | 
            -
            <div class="language-ruby highlighter-rouge"><div class="custom-class"><pre class="highlight"><code><span class="nb">puts</span> <span class="s2">"Hello"</span>
         | 
| 1 | 
            +
            <div class="language-ruby highlighter-rouge"><div class="custom-class"><div class="highlight"><pre class="highlight"><code><span class="nb">puts</span> <span class="s2">"Hello"</span>
         | 
| 2 2 | 
             
            </code></pre>
         | 
| 3 | 
            -
            </div></div>
         | 
| 3 | 
            +
            </div></div></div>
         | 
| 4 4 |  | 
| 5 | 
            -
            <div class="language-ruby highlighter-rouge"><div class="custom-class"><pre class="highlight"><code><span class="nb">puts</span> <span class="s2">"World"</span>
         | 
| 5 | 
            +
            <div class="language-ruby highlighter-rouge"><div class="custom-class"><div class="highlight"><pre class="highlight"><code><span class="nb">puts</span> <span class="s2">"World"</span>
         | 
| 6 6 | 
             
            </code></pre>
         | 
| 7 | 
            -
            </div></div>
         | 
| 7 | 
            +
            </div></div></div>
         | 
| 8 8 |  | 
| 9 | 
            -
            <div class="language-php highlighter-rouge"><div class="custom-class"><pre class="highlight"><code><span class="nv">$foo</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Bar</span><span class="p">;</span>
         | 
| 9 | 
            +
            <div class="language-php highlighter-rouge"><div class="custom-class"><div class="highlight"><pre class="highlight"><code><span class="nv">$foo</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Bar</span><span class="p">;</span>
         | 
| 10 10 | 
             
            </code></pre>
         | 
| 11 | 
            -
            </div></div>
         | 
| 11 | 
            +
            </div></div></div>
         | 
| @@ -1,10 +1,10 @@ | |
| 1 | 
            -
            <div class="language-ruby highlighter-rouge"><pre class="highlight"><code><span class="n">x</span> <span class="o">=</span> <span class="no">Class</span><span class="p">.</span><span class="nf">new</span>
         | 
| 1 | 
            +
            <div class="language-ruby highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="n">x</span> <span class="o">=</span> <span class="no">Class</span><span class="p">.</span><span class="nf">new</span>
         | 
| 2 2 | 
             
            </code></pre>
         | 
| 3 | 
            -
            </div>
         | 
| 4 | 
            -
            <div class="language-html highlighter-rouge"><pre class="highlight"><code><span class="nt"><a></span>href<span class="nt"></a></span>
         | 
| 3 | 
            +
            </div></div>
         | 
| 4 | 
            +
            <div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt"><a></span>href<span class="nt"></a></span>
         | 
| 5 5 | 
             
            </code></pre>
         | 
| 6 | 
            -
            </div>
         | 
| 6 | 
            +
            </div></div>
         | 
| 7 7 |  | 
| 8 | 
            -
            <div class="language-php highlighter-rouge"><pre class="highlight"><code><span class="nv">$foo</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Bar</span><span class="p">;</span>
         | 
| 8 | 
            +
            <div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$foo</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Bar</span><span class="p">;</span>
         | 
| 9 9 | 
             
            </code></pre>
         | 
| 10 | 
            -
            </div>
         | 
| 10 | 
            +
            </div></div>
         | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            * \[and\] another
         | 
| @@ -15,7 +15,7 @@ some <span>*para*</span> | |
| 15 15 | 
             
            <div class="footnotes">
         | 
| 16 16 | 
             
              <ol start="10">
         | 
| 17 17 | 
             
                <li id="fn:ab">
         | 
| 18 | 
            -
                  <p>Some text | 
| 18 | 
            +
                  <p>Some text. <a href="#fnref:ab" class="reversefootnote">↩</a></p>
         | 
| 19 19 | 
             
                </li>
         | 
| 20 20 | 
             
              </ol>
         | 
| 21 21 | 
             
            </div>
         | 
| @@ -7,7 +7,7 @@ | |
| 7 7 | 
             
            <div class="footnotes">
         | 
| 8 8 | 
             
              <ol>
         | 
| 9 9 | 
             
                <li id="fn:1">
         | 
| 10 | 
            -
                  <p>Some footnote content here | 
| 10 | 
            +
                  <p>Some footnote content here <a href="#fnref:1" class="reversefootnote">↩</a></p>
         | 
| 11 11 | 
             
                </li>
         | 
| 12 12 | 
             
              </ol>
         | 
| 13 13 | 
             
            </div>
         | 
| @@ -0,0 +1,8 @@ | |
| 1 | 
            +
            <h1 id="header"><a href="test.html">Header</a></h1>
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            <h1 id="header-1"><a href="test.html">Header</a></h1>
         | 
| 4 | 
            +
             | 
| 5 | 
            +
            <ul id="markdown-toc">
         | 
| 6 | 
            +
              <li><a href="#header" id="markdown-toc-header">Header</a></li>
         | 
| 7 | 
            +
              <li><a href="#header-1" id="markdown-toc-header-1">Header</a></li>
         | 
| 8 | 
            +
            </ul>
         | 
| @@ -3,7 +3,7 @@ | |
| 3 3 | 
             
            <div class="footnotes">
         | 
| 4 4 | 
             
              <ol>
         | 
| 5 5 | 
             
                <li id="fn:fn">
         | 
| 6 | 
            -
                  <p>Some text here | 
| 6 | 
            +
                  <p>Some text here <a href="#fnref:fn" class="reversefootnote">text &8617; <img /></a></p>
         | 
| 7 7 | 
             
                </li>
         | 
| 8 8 | 
             
              </ol>
         | 
| 9 9 | 
             
            </div>
         | 
| @@ -3,10 +3,10 @@ | |
| 3 3 | 
             
            <div class="footnotes">
         | 
| 4 4 | 
             
              <ol start="35">
         | 
| 5 5 | 
             
                <li id="fn:ab">
         | 
| 6 | 
            -
                  <p>Some text | 
| 6 | 
            +
                  <p>Some text. <a href="#fnref:ab" class="reversefootnote">↩</a></p>
         | 
| 7 7 | 
             
                </li>
         | 
| 8 8 | 
             
                <li id="fn:bc">
         | 
| 9 | 
            -
                  <p>Some other text | 
| 9 | 
            +
                  <p>Some other text. <a href="#fnref:bc" class="reversefootnote">↩</a></p>
         | 
| 10 10 | 
             
                </li>
         | 
| 11 11 | 
             
              </ol>
         | 
| 12 12 | 
             
            </div>
         | 
| @@ -5,13 +5,13 @@ | |
| 5 5 | 
             
            <div class="footnotes">
         | 
| 6 6 | 
             
              <ol>
         | 
| 7 7 | 
             
                <li id="fn:first">
         | 
| 8 | 
            -
                  <p>Consecutur adisping.<sup id="fnref:third"><a href="#fn:third" class="footnote">3</a></sup | 
| 8 | 
            +
                  <p>Consecutur adisping.<sup id="fnref:third"><a href="#fn:third" class="footnote">3</a></sup> <a href="#fnref:first" class="reversefootnote">↩</a></p>
         | 
| 9 9 | 
             
                </li>
         | 
| 10 10 | 
             
                <li id="fn:second">
         | 
| 11 | 
            -
                  <p>Sed ut perspiciatis unde omnis | 
| 11 | 
            +
                  <p>Sed ut perspiciatis unde omnis. <a href="#fnref:second" class="reversefootnote">↩</a></p>
         | 
| 12 12 | 
             
                </li>
         | 
| 13 13 | 
             
                <li id="fn:third">
         | 
| 14 | 
            -
                  <p>Sed ut | 
| 14 | 
            +
                  <p>Sed ut. <a href="#fnref:third" class="reversefootnote">↩</a></p>
         | 
| 15 15 | 
             
                </li>
         | 
| 16 16 | 
             
              </ol>
         | 
| 17 17 | 
             
            </div>
         | 
| @@ -10,14 +10,14 @@ and a quote | |
| 10 10 | 
             
            \end{quote}
         | 
| 11 11 |  | 
| 12 12 | 
             
            \begin{itemize}
         | 
| 13 | 
            -
            \item and a list item \footnote{some \emph{text}}
         | 
| 13 | 
            +
            \item{} and a list item \footnote{some \emph{text}}
         | 
| 14 14 | 
             
            \end{itemize}
         | 
| 15 15 |  | 
| 16 16 | 
             
            \section*{And a header\footnote{\begin{verbatim}code block
         | 
| 17 17 | 
             
            continued here
         | 
| 18 18 | 
             
            \end{verbatim}}}
         | 
| 19 19 |  | 
| 20 | 
            -
            A marker without a definition [\^{}without].
         | 
| 20 | 
            +
            A marker without a definition {[}\^{}without{]}.
         | 
| 21 21 |  | 
| 22 22 | 
             
            A marker \footnote{} used twice\footnote{Some foot note text} and thrice\footnote{Some foot note text}.
         | 
| 23 23 |  | 
| @@ -0,0 +1 @@ | |
| 1 | 
            +
            :entity_output: :numeric
         | 
| @@ -0,0 +1,9 @@ | |
| 1 | 
            +
            <p>There is a <abbr title="Text File">TXT</abbr> file here. <sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup></p>
         | 
| 2 | 
            +
             | 
| 3 | 
            +
            <div class="footnotes">
         | 
| 4 | 
            +
              <ol>
         | 
| 5 | 
            +
                <li id="fn:1">
         | 
| 6 | 
            +
                  <p>A <abbr title="Text File">TXT</abbr> file. <a href="#fnref:1" class="reversefootnote">↩</a></p>
         | 
| 7 | 
            +
                </li>
         | 
| 8 | 
            +
              </ol>
         | 
| 9 | 
            +
            </div>
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: kramdown
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 1. | 
| 4 | 
            +
              version: 1.15.0
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Thomas Leitner
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2017- | 
| 11 | 
            +
            date: 2017-09-08 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: minitest
         | 
| @@ -42,16 +42,16 @@ dependencies: | |
| 42 42 | 
             
              name: rouge
         | 
| 43 43 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| 44 44 | 
             
                requirements:
         | 
| 45 | 
            -
                - - " | 
| 45 | 
            +
                - - ">="
         | 
| 46 46 | 
             
                  - !ruby/object:Gem::Version
         | 
| 47 | 
            -
                    version: ' | 
| 47 | 
            +
                    version: '0'
         | 
| 48 48 | 
             
              type: :development
         | 
| 49 49 | 
             
              prerelease: false
         | 
| 50 50 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 51 51 | 
             
                requirements:
         | 
| 52 | 
            -
                - - " | 
| 52 | 
            +
                - - ">="
         | 
| 53 53 | 
             
                  - !ruby/object:Gem::Version
         | 
| 54 | 
            -
                    version: ' | 
| 54 | 
            +
                    version: '0'
         | 
| 55 55 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 56 56 | 
             
              name: stringex
         | 
| 57 57 | 
             
              requirement: !ruby/object:Gem::Requirement
         | 
| @@ -167,7 +167,6 @@ files: | |
| 167 167 | 
             
            - doc/tests.page
         | 
| 168 168 | 
             
            - doc/virtual
         | 
| 169 169 | 
             
            - lib/kramdown.rb
         | 
| 170 | 
            -
            - lib/kramdown/compatibility.rb
         | 
| 171 170 | 
             
            - lib/kramdown/converter.rb
         | 
| 172 171 | 
             
            - lib/kramdown/converter/base.rb
         | 
| 173 172 | 
             
            - lib/kramdown/converter/hash_ast.rb
         | 
| @@ -351,6 +350,8 @@ files: | |
| 351 350 | 
             
            - test/testcases/block/07_horizontal_rule/sepspaces.text
         | 
| 352 351 | 
             
            - test/testcases/block/07_horizontal_rule/septabs.html
         | 
| 353 352 | 
             
            - test/testcases/block/07_horizontal_rule/septabs.text
         | 
| 353 | 
            +
            - test/testcases/block/08_list/brackets_in_item.latex
         | 
| 354 | 
            +
            - test/testcases/block/08_list/brackets_in_item.text
         | 
| 354 355 | 
             
            - test/testcases/block/08_list/escaping.html
         | 
| 355 356 | 
             
            - test/testcases/block/08_list/escaping.text
         | 
| 356 357 | 
             
            - test/testcases/block/08_list/item_ial.html
         | 
| @@ -555,6 +556,9 @@ files: | |
| 555 556 | 
             
            - test/testcases/block/16_toc/toc_with_footnotes.html
         | 
| 556 557 | 
             
            - test/testcases/block/16_toc/toc_with_footnotes.options
         | 
| 557 558 | 
             
            - test/testcases/block/16_toc/toc_with_footnotes.text
         | 
| 559 | 
            +
            - test/testcases/block/16_toc/toc_with_links.html
         | 
| 560 | 
            +
            - test/testcases/block/16_toc/toc_with_links.options
         | 
| 561 | 
            +
            - test/testcases/block/16_toc/toc_with_links.text
         | 
| 558 562 | 
             
            - test/testcases/encoding.html
         | 
| 559 563 | 
             
            - test/testcases/encoding.text
         | 
| 560 564 | 
             
            - test/testcases/man/example.man
         | 
| @@ -584,6 +588,8 @@ files: | |
| 584 588 | 
             
            - test/testcases/span/01_link/inline.html
         | 
| 585 589 | 
             
            - test/testcases/span/01_link/inline.html.19
         | 
| 586 590 | 
             
            - test/testcases/span/01_link/inline.text
         | 
| 591 | 
            +
            - test/testcases/span/01_link/latex_escaping.latex
         | 
| 592 | 
            +
            - test/testcases/span/01_link/latex_escaping.text
         | 
| 587 593 | 
             
            - test/testcases/span/01_link/link_defs.html
         | 
| 588 594 | 
             
            - test/testcases/span/01_link/link_defs.text
         | 
| 589 595 | 
             
            - test/testcases/span/01_link/link_defs_with_ial.html
         | 
| @@ -634,10 +640,13 @@ files: | |
| 634 640 | 
             
            - test/testcases/span/04_footnote/inside_footnote.text
         | 
| 635 641 | 
             
            - test/testcases/span/04_footnote/markers.html
         | 
| 636 642 | 
             
            - test/testcases/span/04_footnote/markers.latex
         | 
| 643 | 
            +
            - test/testcases/span/04_footnote/markers.options
         | 
| 637 644 | 
             
            - test/testcases/span/04_footnote/markers.text
         | 
| 638 645 | 
             
            - test/testcases/span/04_footnote/placement.html
         | 
| 646 | 
            +
            - test/testcases/span/04_footnote/placement.options
         | 
| 639 647 | 
             
            - test/testcases/span/04_footnote/placement.text
         | 
| 640 648 | 
             
            - test/testcases/span/04_footnote/regexp_problem.html
         | 
| 649 | 
            +
            - test/testcases/span/04_footnote/regexp_problem.options
         | 
| 641 650 | 
             
            - test/testcases/span/04_footnote/regexp_problem.text
         | 
| 642 651 | 
             
            - test/testcases/span/04_footnote/without_backlink.html
         | 
| 643 652 | 
             
            - test/testcases/span/04_footnote/without_backlink.options
         | 
| @@ -664,6 +673,8 @@ files: | |
| 664 673 | 
             
            - test/testcases/span/abbreviations/abbrev.text
         | 
| 665 674 | 
             
            - test/testcases/span/abbreviations/abbrev_defs.html
         | 
| 666 675 | 
             
            - test/testcases/span/abbreviations/abbrev_defs.text
         | 
| 676 | 
            +
            - test/testcases/span/abbreviations/in_footnote.html
         | 
| 677 | 
            +
            - test/testcases/span/abbreviations/in_footnote.text
         | 
| 667 678 | 
             
            - test/testcases/span/autolinks/url_links.html
         | 
| 668 679 | 
             
            - test/testcases/span/autolinks/url_links.text
         | 
| 669 680 | 
             
            - test/testcases/span/escaped_chars/normal.html
         | 
| @@ -764,7 +775,7 @@ required_ruby_version: !ruby/object:Gem::Requirement | |
| 764 775 | 
             
              requirements:
         | 
| 765 776 | 
             
              - - ">="
         | 
| 766 777 | 
             
                - !ruby/object:Gem::Version
         | 
| 767 | 
            -
                  version: '0'
         | 
| 778 | 
            +
                  version: '2.0'
         | 
| 768 779 | 
             
            required_rubygems_version: !ruby/object:Gem::Requirement
         | 
| 769 780 | 
             
              requirements:
         | 
| 770 781 | 
             
              - - ">="
         | 
| @@ -1,48 +0,0 @@ | |
| 1 | 
            -
            # -*- coding: utf-8 -*-
         | 
| 2 | 
            -
            #
         | 
| 3 | 
            -
            #--
         | 
| 4 | 
            -
            # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
         | 
| 5 | 
            -
            #
         | 
| 6 | 
            -
            # This file is part of kramdown which is licensed under the MIT.
         | 
| 7 | 
            -
            #++
         | 
| 8 | 
            -
            #
         | 
| 9 | 
            -
            # All the code in this file is backported from Ruby 1.8.7 sothat kramdown works under 1.8.5
         | 
| 10 | 
            -
            #
         | 
| 11 | 
            -
            # :stopdoc:
         | 
| 12 | 
            -
             | 
| 13 | 
            -
            require 'rbconfig'
         | 
| 14 | 
            -
             | 
| 15 | 
            -
            if RUBY_VERSION <= '1.8.6'
         | 
| 16 | 
            -
              require 'rexml/parsers/baseparser'
         | 
| 17 | 
            -
              module REXML
         | 
| 18 | 
            -
                module Parsers
         | 
| 19 | 
            -
                  class BaseParser
         | 
| 20 | 
            -
                    UNAME_STR= "(?:#{NCNAME_STR}:)?#{NCNAME_STR}" unless const_defined?(:UNAME_STR)
         | 
| 21 | 
            -
                  end
         | 
| 22 | 
            -
                end
         | 
| 23 | 
            -
              end
         | 
| 24 | 
            -
             | 
| 25 | 
            -
              if !String.instance_methods.include?("start_with?")
         | 
| 26 | 
            -
             | 
| 27 | 
            -
                class String
         | 
| 28 | 
            -
                  def start_with?(str)
         | 
| 29 | 
            -
                    self[0, str.length] == str
         | 
| 30 | 
            -
                  end
         | 
| 31 | 
            -
                  def end_with?(str)
         | 
| 32 | 
            -
                    self[-str.length, str.length] == str
         | 
| 33 | 
            -
                  end
         | 
| 34 | 
            -
                end
         | 
| 35 | 
            -
             | 
| 36 | 
            -
              end
         | 
| 37 | 
            -
             | 
| 38 | 
            -
            end
         | 
| 39 | 
            -
             | 
| 40 | 
            -
            if !Symbol.instance_methods.include?("<=>")
         | 
| 41 | 
            -
             | 
| 42 | 
            -
              class Symbol
         | 
| 43 | 
            -
                def <=>(other)
         | 
| 44 | 
            -
                  self.to_s <=> other.to_s
         | 
| 45 | 
            -
                end
         | 
| 46 | 
            -
              end
         | 
| 47 | 
            -
             | 
| 48 | 
            -
            end
         |