kramdown 1.14.0 → 1.15.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of kramdown might be problematic. Click here for more details.

Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTERS +1 -1
  3. data/Rakefile +2 -1
  4. data/VERSION +1 -1
  5. data/doc/index.page +2 -2
  6. data/doc/syntax.page +4 -0
  7. data/lib/kramdown/converter/html.rb +20 -4
  8. data/lib/kramdown/converter/latex.rb +6 -4
  9. data/lib/kramdown/document.rb +1 -4
  10. data/lib/kramdown/parser/base.rb +9 -15
  11. data/lib/kramdown/parser/kramdown.rb +4 -1
  12. data/lib/kramdown/parser/kramdown/autolink.rb +1 -7
  13. data/lib/kramdown/utils/html.rb +1 -1
  14. data/lib/kramdown/utils/ordered_hash.rb +1 -75
  15. data/lib/kramdown/utils/unidecoder.rb +1 -1
  16. data/lib/kramdown/version.rb +1 -1
  17. data/test/testcases/block/06_codeblock/rouge/multiple.html +6 -6
  18. data/test/testcases/block/06_codeblock/rouge/simple.html +6 -6
  19. data/test/testcases/block/08_list/brackets_in_item.latex +3 -0
  20. data/test/testcases/block/08_list/brackets_in_item.text +1 -0
  21. data/test/testcases/block/12_extension/options.html +1 -1
  22. data/test/testcases/block/12_extension/options2.html +1 -1
  23. data/test/testcases/block/16_toc/toc_with_footnotes.html +1 -1
  24. data/test/testcases/block/16_toc/toc_with_links.html +8 -0
  25. data/test/testcases/block/16_toc/toc_with_links.options +2 -0
  26. data/test/testcases/block/16_toc/toc_with_links.text +8 -0
  27. data/test/testcases/span/01_link/latex_escaping.latex +6 -0
  28. data/test/testcases/span/01_link/latex_escaping.text +5 -0
  29. data/test/testcases/span/04_footnote/backlink_text.html +1 -1
  30. data/test/testcases/span/04_footnote/definitions.latex +2 -2
  31. data/test/testcases/span/04_footnote/footnote_nr.html +2 -2
  32. data/test/testcases/span/04_footnote/inside_footnote.html +3 -3
  33. data/test/testcases/span/04_footnote/markers.latex +2 -2
  34. data/test/testcases/span/04_footnote/markers.options +2 -0
  35. data/test/testcases/span/04_footnote/placement.html +1 -1
  36. data/test/testcases/span/04_footnote/placement.options +1 -0
  37. data/test/testcases/span/04_footnote/regexp_problem.options +2 -0
  38. data/test/testcases/span/abbreviations/in_footnote.html +9 -0
  39. data/test/testcases/span/abbreviations/in_footnote.text +5 -0
  40. metadata +19 -8
  41. data/lib/kramdown/compatibility.rb +0 -48
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f25c643525687184c1434ee51de53d28b8237de4
4
- data.tar.gz: a9c68da82ab28b9bdacca96b9e514be75074eb95
3
+ metadata.gz: 69c006f3143fcd067cb7c1a27f80baf39870e3e7
4
+ data.tar.gz: 88ae530383c5a4cacf7791cfb8c451a2fac49355
5
5
  SHA512:
6
- metadata.gz: 94d832f8a619061f2f640678aad4411bf9551443ccc048bf21e10a2f568488c009598eef54b4898c2cda2ff86cd55db4c9112d9468a8be9ffa2d87d02ad3e6d0
7
- data.tar.gz: 4171a7226bf13985a08886f8af41073aad599bb09db839d3c7481b77399106e46048f41240c893a6f79b16053a08545bf890b1373d43517ef181e5faa76ea906
6
+ metadata.gz: 603752731df3717905665935bd5b3e412943a09de2b5d776f18d6fe1cecca18e210541e81c7863f43a42b469e2a3e5e232b4bce43671abdbfa9a557f01eb78e5
7
+ data.tar.gz: 8d62fd7e8905d385fb1d269b03f09abb237e8953830d1e01e7ee5e56b10ec796a47fd03c7ac7c3d87dbcdfe4cfc11a2bbf3f04bef1c25b3a5d5b17aa0ae70048
@@ -1,6 +1,6 @@
1
1
  Count Name
2
2
  ======= ====
3
- 847 Thomas Leitner <t_leitner@gmx.at>
3
+ 861 Thomas Leitner <t_leitner@gmx.at>
4
4
  6 Gioele Barabucci <gioele@svario.it>
5
5
  4 Ted Pak <powerpak006@gmail.com>
6
6
  4 Shuanglei Tao <tsl0922@gmail.com>
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', '~> 1.8'
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.14.0
1
+ 1.15.0
@@ -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.14.0**{:itemprop="softwareVersion"} released on
101
- **2017-06-26**{:itemprop="datePublished"}, [more news](news.html)
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>
@@ -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(remove_footnotes(Marshal.load(Marshal.dump(children))))
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) if result.respond_to?(:force_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
- para.children << Element.new(:raw, FOOTNOTE_BACKLINK_FMT % [insert_space ? '&nbsp;' : '', name, backlink_text])
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 % ["&nbsp;", "#{name}:#{index}", "#{backlink_text}<sup>#{index+1}</sup>"])
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{#{escape(url[1..-1])}}{#{inner(el, opts)}}"
213
+ "\\hyperlink{#{url[1..-1].gsub('%', "\\%")}}{#{inner(el, opts)}}"
214
214
  else
215
- "\\href{#{escape(url)}}{#{inner(el, opts)}}"
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
 
@@ -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.exists?(@@data_dir)
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
@@ -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
- if source.respond_to?(:encode)
93
- if !source.valid_encoding?
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
- if strscan.string.respond_to?(:encoding)
117
- begin
118
- enc = strscan.string.encoding
119
- strscan.string.force_encoding('ASCII-8BIT')
120
- result = strscan.string[range].force_encoding(enc)
121
- ensure
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 {|name,data| update_tree(data[:content])}
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
- if RUBY_VERSION == '1.8.5'
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
 
@@ -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 e.char.respond_to?(:encoding) && entity_output == :as_char &&
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
- if RUBY_VERSION < '1.9'
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
 
@@ -18,7 +18,7 @@ module Kramdown
18
18
  gem 'stringex' if defined?(Gem)
19
19
  path = $:.find {|dir| File.directory?(File.join(File.expand_path(dir), "stringex", "unidecoder_data"))}
20
20
 
21
- if RUBY_VERSION <= '1.8.6' || !path
21
+ if !path
22
22
  def self.decode(string)
23
23
  string
24
24
  end
@@ -10,6 +10,6 @@
10
10
  module Kramdown
11
11
 
12
12
  # The kramdown version.
13
- VERSION = '1.14.0'
13
+ VERSION = '1.15.0'
14
14
 
15
15
  end
@@ -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">&lt;a&gt;</span>href<span class="nt">&lt;/a&gt;</span>
3
+ </div></div>
4
+ <div class="language-html highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nt">&lt;a&gt;</span>href<span class="nt">&lt;/a&gt;</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,3 @@
1
+ \begin{itemize}
2
+ \item{} {[}and{]} another
3
+ \end{itemize}
@@ -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.&nbsp;<a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
18
+ <p>Some text. <a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
19
19
  </li>
20
20
  </ol>
21
21
  </div>
@@ -4,7 +4,7 @@
4
4
  <div class="footnotes">
5
5
  <ol>
6
6
  <li id="fn:ab">
7
- <p>Some text.&nbsp;<a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
7
+ <p>Some text. <a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
8
8
  </li>
9
9
  </ol>
10
10
  </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&nbsp;<a href="#fnref:1" class="reversefootnote">&#8617;</a></p>
10
+ <p>Some footnote content here <a href="#fnref:1" class="reversefootnote">&#8617;</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>
@@ -0,0 +1,2 @@
1
+ :auto_ids: true
2
+ :auto_id_stripping: true
@@ -0,0 +1,8 @@
1
+ # [Header]
2
+
3
+ # [Header]
4
+
5
+ [header]: test.html
6
+
7
+ * toc
8
+ {:toc}
@@ -0,0 +1,6 @@
1
+ \href{https://example.com/~tilde/}{https://example.com/\ensuremath{\sim}tilde/}
2
+
3
+ \href{http://example.com/percent\%20percent}{http://example.com/percent\%20percent}
4
+
5
+ \href{http://example.com/hash#hash}{http://example.com/hash\#hash}
6
+
@@ -0,0 +1,5 @@
1
+ <https://example.com/~tilde/>
2
+
3
+ <http://example.com/percent%20percent>
4
+
5
+ <http://example.com/hash#hash>
@@ -3,7 +3,7 @@
3
3
  <div class="footnotes">
4
4
  <ol>
5
5
  <li id="fn:fn">
6
- <p>Some text here&nbsp;<a href="#fnref:fn" class="reversefootnote">text &8617; &lt;img /&gt;</a></p>
6
+ <p>Some text here <a href="#fnref:fn" class="reversefootnote">text &8617; &lt;img /&gt;</a></p>
7
7
  </li>
8
8
  </ol>
9
9
  </div>
@@ -5,12 +5,12 @@ blockquote
5
5
  \end{quote}
6
6
 
7
7
  \begin{itemize}
8
- \item a list
8
+ \item{} a list
9
9
  with some text
10
10
  \end{itemize}
11
11
 
12
12
  \begin{itemize}
13
- \item other list
13
+ \item{} other list
14
14
  \end{itemize}
15
15
  \begin{verbatim}code
16
16
  \end{verbatim}
@@ -3,10 +3,10 @@
3
3
  <div class="footnotes">
4
4
  <ol start="35">
5
5
  <li id="fn:ab">
6
- <p>Some text.&nbsp;<a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
6
+ <p>Some text. <a href="#fnref:ab" class="reversefootnote">&#8617;</a></p>
7
7
  </li>
8
8
  <li id="fn:bc">
9
- <p>Some other text.&nbsp;<a href="#fnref:bc" class="reversefootnote">&#8617;</a></p>
9
+ <p>Some other text. <a href="#fnref:bc" class="reversefootnote">&#8617;</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>&nbsp;<a href="#fnref:first" class="reversefootnote">&#8617;</a></p>
8
+ <p>Consecutur adisping.<sup id="fnref:third"><a href="#fn:third" class="footnote">3</a></sup> <a href="#fnref:first" class="reversefootnote">&#8617;</a></p>
9
9
  </li>
10
10
  <li id="fn:second">
11
- <p>Sed ut perspiciatis unde omnis.&nbsp;<a href="#fnref:second" class="reversefootnote">&#8617;</a></p>
11
+ <p>Sed ut perspiciatis unde omnis. <a href="#fnref:second" class="reversefootnote">&#8617;</a></p>
12
12
  </li>
13
13
  <li id="fn:third">
14
- <p>Sed ut.&nbsp;<a href="#fnref:third" class="reversefootnote">&#8617;</a></p>
14
+ <p>Sed ut. <a href="#fnref:third" class="reversefootnote">&#8617;</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,2 @@
1
+ :auto_ids: false
2
+ :entity_output: :symbolic
@@ -1,7 +1,7 @@
1
1
  <div class="footnotes">
2
2
  <ol>
3
3
  <li id="fn:1">
4
- <p>Footnote \` text&nbsp;<a href="#fnref:1" class="reversefootnote">&#8617;</a></p>
4
+ <p>Footnote \` text&#160;<a href="#fnref:1" class="reversefootnote">&#8617;</a></p>
5
5
  </li>
6
6
  </ol>
7
7
  </div>
@@ -0,0 +1 @@
1
+ :entity_output: :numeric
@@ -0,0 +1,2 @@
1
+ :auto_ids: false
2
+ :entity_output: :symbolic
@@ -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">&#8617;</a></p>
7
+ </li>
8
+ </ol>
9
+ </div>
@@ -0,0 +1,5 @@
1
+ There is a TXT file here. [^1]
2
+
3
+ *[TXT]: Text File
4
+
5
+ [^1]: A TXT file.
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.14.0
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-06-26 00:00:00.000000000 Z
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: '1.8'
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: '1.8'
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