kramdown 1.17.0 → 2.0.0.beta1

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 (196) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTERS +4 -2
  3. data/VERSION +1 -1
  4. data/bin/kramdown +13 -14
  5. data/lib/kramdown.rb +2 -2
  6. data/lib/kramdown/converter.rb +6 -7
  7. data/lib/kramdown/converter/base.rb +18 -29
  8. data/lib/kramdown/converter/hash_ast.rb +4 -4
  9. data/lib/kramdown/converter/html.rb +82 -67
  10. data/lib/kramdown/converter/kramdown.rb +83 -78
  11. data/lib/kramdown/converter/latex.rb +53 -47
  12. data/lib/kramdown/converter/man.rb +22 -25
  13. data/lib/kramdown/converter/math_engine/mathjax.rb +10 -10
  14. data/lib/kramdown/converter/remove_html_tags.rb +2 -2
  15. data/lib/kramdown/converter/syntax_highlighter.rb +2 -2
  16. data/lib/kramdown/converter/syntax_highlighter/minted.rb +2 -2
  17. data/lib/kramdown/converter/syntax_highlighter/rouge.rb +5 -5
  18. data/lib/kramdown/converter/toc.rb +5 -5
  19. data/lib/kramdown/document.rb +9 -11
  20. data/lib/kramdown/element.rb +11 -9
  21. data/lib/kramdown/error.rb +2 -2
  22. data/lib/kramdown/options.rb +258 -384
  23. data/lib/kramdown/parser.rb +2 -3
  24. data/lib/kramdown/parser/base.rb +7 -6
  25. data/lib/kramdown/parser/html.rb +103 -95
  26. data/lib/kramdown/parser/kramdown.rb +32 -36
  27. data/lib/kramdown/parser/kramdown/abbreviation.rb +13 -10
  28. data/lib/kramdown/parser/kramdown/autolink.rb +3 -3
  29. data/lib/kramdown/parser/kramdown/blank_line.rb +2 -2
  30. data/lib/kramdown/parser/kramdown/block_boundary.rb +2 -2
  31. data/lib/kramdown/parser/kramdown/blockquote.rb +4 -5
  32. data/lib/kramdown/parser/kramdown/codeblock.rb +4 -5
  33. data/lib/kramdown/parser/kramdown/codespan.rb +5 -5
  34. data/lib/kramdown/parser/kramdown/emphasis.rb +6 -6
  35. data/lib/kramdown/parser/kramdown/eob.rb +2 -2
  36. data/lib/kramdown/parser/kramdown/escaped_chars.rb +2 -2
  37. data/lib/kramdown/parser/kramdown/extensions.rb +31 -26
  38. data/lib/kramdown/parser/kramdown/footnote.rb +7 -6
  39. data/lib/kramdown/parser/kramdown/header.rb +6 -6
  40. data/lib/kramdown/parser/kramdown/horizontal_rule.rb +3 -3
  41. data/lib/kramdown/parser/kramdown/html.rb +31 -26
  42. data/lib/kramdown/parser/kramdown/html_entity.rb +6 -5
  43. data/lib/kramdown/parser/kramdown/line_break.rb +3 -3
  44. data/lib/kramdown/parser/kramdown/link.rb +13 -11
  45. data/lib/kramdown/parser/kramdown/list.rb +38 -40
  46. data/lib/kramdown/parser/kramdown/math.rb +4 -5
  47. data/lib/kramdown/parser/kramdown/paragraph.rb +5 -5
  48. data/lib/kramdown/parser/kramdown/smart_quotes.rb +23 -23
  49. data/lib/kramdown/parser/kramdown/table.rb +18 -17
  50. data/lib/kramdown/parser/kramdown/typographic_symbol.rb +8 -8
  51. data/lib/kramdown/parser/markdown.rb +9 -8
  52. data/lib/kramdown/utils.rb +5 -6
  53. data/lib/kramdown/utils/configurable.rb +7 -6
  54. data/lib/kramdown/utils/entities.rb +286 -289
  55. data/lib/kramdown/utils/html.rb +10 -12
  56. data/lib/kramdown/utils/lru_cache.rb +3 -2
  57. data/lib/kramdown/utils/string_scanner.rb +2 -3
  58. data/lib/kramdown/utils/unidecoder.rb +8 -6
  59. data/lib/kramdown/version.rb +3 -3
  60. data/man/man1/kramdown.1 +3 -107
  61. data/test/run_tests.rb +6 -6
  62. data/test/test_files.rb +122 -298
  63. data/test/test_location.rb +8 -30
  64. data/test/test_string_scanner_kramdown.rb +6 -9
  65. data/test/testcases/block/06_codeblock/highlighting-opts.html +6 -6
  66. data/test/testcases/block/06_codeblock/highlighting.html +5 -6
  67. data/test/testcases/block/06_codeblock/with_lang_in_fenced_block.options +1 -1
  68. data/test/testcases/block/07_horizontal_rule/error.html +2 -2
  69. data/test/testcases/block/09_html/html5_attributes.html +2 -0
  70. data/test/testcases/block/09_html/html5_attributes.text +2 -0
  71. data/test/testcases/block/09_html/html_to_native/typography.html +1 -1
  72. data/test/testcases/block/09_html/simple.html +1 -1
  73. data/test/testcases/block/12_extension/options3.html +7 -6
  74. data/test/testcases/block/12_extension/options3.text +2 -2
  75. data/test/testcases/span/01_link/inline.html +1 -1
  76. data/test/testcases/span/01_link/reference.html +3 -3
  77. data/test/testcases/span/03_codespan/highlighting.html +1 -1
  78. data/test/testcases/span/text_substitutions/entities_as_char.html +1 -1
  79. metadata +5 -234
  80. data/Rakefile +0 -341
  81. data/benchmark/benchmark.rb +0 -43
  82. data/benchmark/benchmark.sh +0 -74
  83. data/benchmark/generate_data.rb +0 -119
  84. data/benchmark/mdbasics.text +0 -306
  85. data/benchmark/mdsyntax.text +0 -888
  86. data/benchmark/testing.sh +0 -12
  87. data/benchmark/timing.sh +0 -10
  88. data/doc/_design.scss +0 -441
  89. data/doc/bg.png +0 -0
  90. data/doc/default.scss +0 -217
  91. data/doc/default.template +0 -62
  92. data/doc/documentation.page +0 -84
  93. data/doc/documentation.template +0 -36
  94. data/doc/index.page +0 -113
  95. data/doc/installation.page +0 -88
  96. data/doc/links.markdown +0 -6
  97. data/doc/metainfo +0 -13
  98. data/doc/news.feed +0 -9
  99. data/doc/news.page +0 -29
  100. data/doc/options.page +0 -49
  101. data/doc/quickref.page +0 -603
  102. data/doc/sidebar.template +0 -22
  103. data/doc/sitemap.sitemap +0 -5
  104. data/doc/syntax.page +0 -1799
  105. data/doc/tests.page +0 -104
  106. data/doc/virtual +0 -14
  107. data/lib/kramdown/converter/math_engine/itex2mml.rb +0 -39
  108. data/lib/kramdown/converter/math_engine/katex.rb +0 -35
  109. data/lib/kramdown/converter/math_engine/mathjaxnode.rb +0 -56
  110. data/lib/kramdown/converter/math_engine/ritex.rb +0 -38
  111. data/lib/kramdown/converter/math_engine/sskatex.rb +0 -97
  112. data/lib/kramdown/converter/pdf.rb +0 -625
  113. data/lib/kramdown/converter/syntax_highlighter/coderay.rb +0 -81
  114. data/lib/kramdown/parser/gfm.rb +0 -188
  115. data/lib/kramdown/utils/ordered_hash.rb +0 -18
  116. data/setup.rb +0 -1585
  117. data/test/testcases/block/07_horizontal_rule/error.html.19 +0 -7
  118. data/test/testcases/block/09_html/html_to_native/typography.html.19 +0 -1
  119. data/test/testcases/block/09_html/simple.html.19 +0 -60
  120. data/test/testcases/block/15_math/itex2mml.html +0 -1
  121. data/test/testcases/block/15_math/itex2mml.options +0 -1
  122. data/test/testcases/block/15_math/itex2mml.text +0 -1
  123. data/test/testcases/block/15_math/katex.html.19 +0 -2
  124. data/test/testcases/block/15_math/katex.options +0 -1
  125. data/test/testcases/block/15_math/katex.text +0 -2
  126. data/test/testcases/block/15_math/mathjaxnode.html.19 +0 -27
  127. data/test/testcases/block/15_math/mathjaxnode.options +0 -1
  128. data/test/testcases/block/15_math/mathjaxnode.text +0 -1
  129. data/test/testcases/block/15_math/mathjaxnode_notexhints.html.19 +0 -23
  130. data/test/testcases/block/15_math/mathjaxnode_notexhints.options +0 -3
  131. data/test/testcases/block/15_math/mathjaxnode_notexhints.text +0 -1
  132. data/test/testcases/block/15_math/mathjaxnode_semantics.html.19 +0 -32
  133. data/test/testcases/block/15_math/mathjaxnode_semantics.options +0 -3
  134. data/test/testcases/block/15_math/mathjaxnode_semantics.text +0 -1
  135. data/test/testcases/block/15_math/ritex.html +0 -1
  136. data/test/testcases/block/15_math/ritex.options +0 -1
  137. data/test/testcases/block/15_math/ritex.text +0 -1
  138. data/test/testcases/block/15_math/sskatex.html.19 +0 -2
  139. data/test/testcases/block/15_math/sskatex.options +0 -1
  140. data/test/testcases/block/15_math/sskatex.text +0 -2
  141. data/test/testcases/span/01_link/inline.html.19 +0 -46
  142. data/test/testcases/span/01_link/reference.html.19 +0 -37
  143. data/test/testcases/span/math/itex2mml.html +0 -1
  144. data/test/testcases/span/math/itex2mml.options +0 -1
  145. data/test/testcases/span/math/itex2mml.text +0 -1
  146. data/test/testcases/span/math/katex.html.19 +0 -1
  147. data/test/testcases/span/math/katex.options +0 -1
  148. data/test/testcases/span/math/katex.text +0 -1
  149. data/test/testcases/span/math/mathjaxnode.html.19 +0 -27
  150. data/test/testcases/span/math/mathjaxnode.options +0 -1
  151. data/test/testcases/span/math/mathjaxnode.text +0 -1
  152. data/test/testcases/span/math/ritex.html +0 -1
  153. data/test/testcases/span/math/ritex.options +0 -1
  154. data/test/testcases/span/math/ritex.text +0 -1
  155. data/test/testcases/span/math/sskatex.html.19 +0 -1
  156. data/test/testcases/span/math/sskatex.options +0 -1
  157. data/test/testcases/span/math/sskatex.text +0 -1
  158. data/test/testcases/span/text_substitutions/entities_as_char.html.19 +0 -1
  159. data/test/testcases_gfm/atx_header.html +0 -3
  160. data/test/testcases_gfm/atx_header.text +0 -3
  161. data/test/testcases_gfm/backticks_disable_highlighting.html +0 -2
  162. data/test/testcases_gfm/backticks_disable_highlighting.options +0 -1
  163. data/test/testcases_gfm/backticks_disable_highlighting.text +0 -3
  164. data/test/testcases_gfm/backticks_syntax.html +0 -20
  165. data/test/testcases_gfm/backticks_syntax.text +0 -19
  166. data/test/testcases_gfm/codeblock_fenced.html +0 -20
  167. data/test/testcases_gfm/codeblock_fenced.options +0 -1
  168. data/test/testcases_gfm/codeblock_fenced.text +0 -21
  169. data/test/testcases_gfm/hard_line_breaks.html +0 -3
  170. data/test/testcases_gfm/hard_line_breaks.text +0 -3
  171. data/test/testcases_gfm/hard_line_breaks_off.html +0 -2
  172. data/test/testcases_gfm/hard_line_breaks_off.options +0 -1
  173. data/test/testcases_gfm/hard_line_breaks_off.text +0 -2
  174. data/test/testcases_gfm/header_ids.html +0 -27
  175. data/test/testcases_gfm/header_ids.html.19 +0 -27
  176. data/test/testcases_gfm/header_ids.options +0 -1
  177. data/test/testcases_gfm/header_ids.text +0 -27
  178. data/test/testcases_gfm/header_ids_with_prefix.html +0 -3
  179. data/test/testcases_gfm/header_ids_with_prefix.options +0 -2
  180. data/test/testcases_gfm/header_ids_with_prefix.text +0 -3
  181. data/test/testcases_gfm/no_typographic.html +0 -3
  182. data/test/testcases_gfm/no_typographic.html.19 +0 -3
  183. data/test/testcases_gfm/no_typographic.options +0 -1
  184. data/test/testcases_gfm/no_typographic.text +0 -3
  185. data/test/testcases_gfm/paragraph_end-disabled.html +0 -31
  186. data/test/testcases_gfm/paragraph_end-disabled.options +0 -1
  187. data/test/testcases_gfm/paragraph_end-disabled.text +0 -27
  188. data/test/testcases_gfm/paragraph_end.html +0 -38
  189. data/test/testcases_gfm/paragraph_end.text +0 -27
  190. data/test/testcases_gfm/strikethrough.html +0 -27
  191. data/test/testcases_gfm/strikethrough.html.19 +0 -27
  192. data/test/testcases_gfm/strikethrough.text +0 -27
  193. data/test/testcases_gfm/task_list.html +0 -40
  194. data/test/testcases_gfm/task_list.text +0 -26
  195. data/test/testcases_gfm/two_para_hard_line_breaks.html +0 -4
  196. data/test/testcases_gfm/two_para_hard_line_breaks.text +0 -4
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -29,7 +29,7 @@ module Kramdown
29
29
  @src.pos += @src.matched_size
30
30
  data = @src[2].strip
31
31
  if before_block_boundary?
32
- @tree.children << new_block_el(:math, data, nil, :category => :block, :location => start_line_number)
32
+ @tree.children << new_block_el(:math, data, nil, category: :block, location: start_line_number)
33
33
  true
34
34
  else
35
35
  @src.revert_pos(saved_pos)
@@ -38,14 +38,13 @@ module Kramdown
38
38
  end
39
39
  define_parser(:block_math, BLOCK_MATH_START)
40
40
 
41
-
42
41
  INLINE_MATH_START = /\$\$(.*?)\$\$/m
43
42
 
44
43
  # Parse the inline math at the current location.
45
44
  def parse_inline_math
46
45
  start_line_number = @src.current_line_number
47
46
  @src.pos += @src.matched_size
48
- @tree.children << Element.new(:math, @src[1].strip, nil, :category => :span, :location => start_line_number)
47
+ @tree.children << Element.new(:math, @src[1].strip, nil, category: :span, location: start_line_number)
49
48
  end
50
49
  define_parser(:inline_math, INLINE_MATH_START, '\$')
51
50
 
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -17,7 +17,7 @@ module Kramdown
17
17
  module Parser
18
18
  class Kramdown
19
19
 
20
- LAZY_END_HTML_SPAN_ELEMENTS = HTML_SPAN_ELEMENTS + %w{script}
20
+ LAZY_END_HTML_SPAN_ELEMENTS = HTML_SPAN_ELEMENTS + %w[script]
21
21
  LAZY_END_HTML_START = /<(?>(?!(?:#{LAZY_END_HTML_SPAN_ELEMENTS.join('|')})\b)#{REXML::Parsers::BaseParser::UNAME_STR})/
22
22
  LAZY_END_HTML_STOP = /<\/(?!(?:#{LAZY_END_HTML_SPAN_ELEMENTS.join('|')})\b)#{REXML::Parsers::BaseParser::UNAME_STR}\s*>/m
23
23
 
@@ -32,7 +32,7 @@ module Kramdown
32
32
  pos = @src.pos
33
33
  start_line_number = @src.current_line_number
34
34
  result = @src.scan(PARAGRAPH_MATCH)
35
- while !@src.match?(paragraph_end)
35
+ until @src.match?(paragraph_end)
36
36
  result << @src.scan(PARAGRAPH_MATCH)
37
37
  end
38
38
  result.rstrip!
@@ -45,7 +45,7 @@ module Kramdown
45
45
  add_text(result, @tree.children.last)
46
46
  end
47
47
  else
48
- @tree.children << new_block_el(:p, nil, nil, :location => start_line_number)
48
+ @tree.children << new_block_el(:p, nil, nil, location: start_line_number)
49
49
  result.lstrip!
50
50
  add_text(result, @tree.children.last)
51
51
  end
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -122,25 +122,25 @@ module Kramdown
122
122
  SQ_CLOSE = %![^\ \\\\\t\r\n\\[{(-]!
123
123
 
124
124
  SQ_RULES = [
125
- [/("|')(?=[_*]{1,2}\S)/, [:lquote1]],
126
- [/("|')(?=#{SQ_PUNCT}(?!\.\.)\B)/, [:rquote1]],
127
- # Special case for double sets of quotes, e.g.:
128
- # <p>He said, "'Quoted' words in a larger quote."</p>
129
- [/(\s?)"'(?=\w)/, [1, :ldquo, :lsquo]],
130
- [/(\s?)'"(?=\w)/, [1, :lsquo, :ldquo]],
131
- # Special case for decade abbreviations (the '80s):
132
- [/(\s?)'(?=\d\ds)/, [1, :rsquo]],
125
+ [/("|')(?=[_*]{1,2}\S)/, [:lquote1]],
126
+ [/("|')(?=#{SQ_PUNCT}(?!\.\.)\B)/, [:rquote1]],
127
+ # Special case for double sets of quotes, e.g.:
128
+ # <p>He said, "'Quoted' words in a larger quote."</p>
129
+ [/(\s?)"'(?=\w)/, [1, :ldquo, :lsquo]],
130
+ [/(\s?)'"(?=\w)/, [1, :lsquo, :ldquo]],
131
+ # Special case for decade abbreviations (the '80s):
132
+ [/(\s?)'(?=\d\ds)/, [1, :rsquo]],
133
133
 
134
- # Get most opening single/double quotes:
135
- [/(\s)('|")(?=\w)/, [1, :lquote2]],
136
- # Single/double closing quotes:
137
- [/(#{SQ_CLOSE})('|")/, [1, :rquote2]],
138
- # Special case for e.g. "<i>Custer</i>'s Last Stand."
139
- [/("|')(?=\s|s\b|$)/, [:rquote1]],
140
- # Any remaining single quotes should be opening ones:
141
- [/(.?)'/m, [1, :lsquo]],
142
- [/(.?)"/m, [1, :ldquo]],
143
- ] #'"
134
+ # Get most opening single/double quotes:
135
+ [/(\s)('|")(?=\w)/, [1, :lquote2]],
136
+ # Single/double closing quotes:
137
+ [/(#{SQ_CLOSE})('|")/, [1, :rquote2]],
138
+ # Special case for e.g. "<i>Custer</i>'s Last Stand."
139
+ [/("|')(?=\s|s\b|$)/, [:rquote1]],
140
+ # Any remaining single quotes should be opening ones:
141
+ [/(.?)'/m, [1, :lsquo]],
142
+ [/(.?)"/m, [1, :ldquo]],
143
+ ] # '"
144
144
 
145
145
  SQ_SUBSTS = {
146
146
  [:rquote1, '"'] => :rdquo,
@@ -157,13 +157,13 @@ module Kramdown
157
157
  # Parse the smart quotes at current location.
158
158
  def parse_smart_quotes
159
159
  start_line_number = @src.current_line_number
160
- substs = SQ_RULES.find {|reg, subst| @src.scan(reg)}[1]
160
+ substs = SQ_RULES.find {|reg, _subst| @src.scan(reg) }[1]
161
161
  substs.each do |subst|
162
162
  if subst.kind_of?(Integer)
163
163
  add_text(@src[subst])
164
164
  else
165
- val = SQ_SUBSTS[[subst, @src[subst.to_s[-1,1].to_i]]] || subst
166
- @tree.children << Element.new(:smart_quote, val, nil, :location => start_line_number)
165
+ val = SQ_SUBSTS[[subst, @src[subst.to_s[-1, 1].to_i]]] || subst
166
+ @tree.children << Element.new(:smart_quote, val, nil, location: start_line_number)
167
167
  end
168
168
  end
169
169
  end
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -23,11 +23,11 @@ module Kramdown
23
23
 
24
24
  # Parse the table at the current location.
25
25
  def parse_table
26
- return false if !after_block_boundary?
26
+ return false unless after_block_boundary?
27
27
 
28
28
  saved_pos = @src.save_pos
29
29
  orig_pos = @src.pos
30
- table = new_block_el(:table, nil, nil, :alignment => [], :location => @src.current_line_number)
30
+ table = new_block_el(:table, nil, nil, alignment: [], location: @src.current_line_number)
31
31
  leading_pipe = (@src.check(TABLE_LINE) =~ /^\s*\|/)
32
32
  @src.scan(TABLE_SEP_LINE)
33
33
 
@@ -43,21 +43,22 @@ module Kramdown
43
43
  end
44
44
  end
45
45
 
46
- while !@src.eos?
47
- break if !@src.check(TABLE_LINE)
46
+ until @src.eos?
47
+ break unless @src.check(TABLE_LINE)
48
48
  if @src.scan(TABLE_SEP_LINE)
49
49
  if rows.empty?
50
50
  # nothing to do, ignoring multiple consecutive separator lines
51
51
  elsif table.options[:alignment].empty? && !has_footer
52
52
  add_container.call(:thead, false)
53
53
  table.options[:alignment] = @src[1].scan(TABLE_HSEP_ALIGN).map do |left, right|
54
- (left.empty? && right.empty? && :default) || (right.empty? && :left) || (left.empty? && :right) || :center
54
+ (left.empty? && right.empty? && :default) || (right.empty? && :left) ||
55
+ (left.empty? && :right) || :center
55
56
  end
56
57
  else # treat as normal separator line
57
58
  add_container.call(:tbody, false)
58
59
  end
59
60
  elsif @src.scan(TABLE_FSEP_LINE)
60
- add_container.call(:tbody, true) if !rows.empty?
61
+ add_container.call(:tbody, true) unless rows.empty?
61
62
  has_footer = true
62
63
  elsif @src.scan(TABLE_ROW_LINE)
63
64
  trow = Element.new(:tr)
@@ -66,16 +67,16 @@ module Kramdown
66
67
  env = save_env
67
68
  cells = []
68
69
  @src[1].split(/(<code.*?>.*?<\/code>)/).each_with_index do |str, i|
69
- if i % 2 == 1
70
+ if i.odd?
70
71
  (cells.empty? ? cells : cells.last) << str
71
72
  else
72
- reset_env(:src => Kramdown::Utils::StringScanner.new(str, @src.current_line_number))
73
+ reset_env(src: Kramdown::Utils::StringScanner.new(str, @src.current_line_number))
73
74
  root = Element.new(:root)
74
75
  parse_spans(root, nil, [:codespan])
75
76
 
76
77
  root.children.each do |c|
77
78
  if c.type == :raw_text
78
- f, *l = c.value.split(/(?<!\\)\|/, -1).map {|t| t.gsub(/\\\|/, '|')}
79
+ f, *l = c.value.split(/(?<!\\)\|/, -1).map {|t| t.gsub(/\\\|/, '|') }
79
80
  (cells.empty? ? cells : cells.last) << f
80
81
  cells.concat(l)
81
82
  else
@@ -102,16 +103,16 @@ module Kramdown
102
103
  end
103
104
  end
104
105
 
105
- if !before_block_boundary?
106
+ unless before_block_boundary?
106
107
  @src.revert_pos(saved_pos)
107
108
  return false
108
109
  end
109
110
 
110
111
  # Parse all lines of the table with the code span parser
111
112
  env = save_env
112
- l_src = ::Kramdown::Utils::StringScanner.new(extract_string(orig_pos...(@src.pos-1), @src),
113
+ l_src = ::Kramdown::Utils::StringScanner.new(extract_string(orig_pos...(@src.pos - 1), @src),
113
114
  @src.current_line_number)
114
- reset_env(:src => l_src)
115
+ reset_env(src: l_src)
115
116
  root = Element.new(:root)
116
117
  parse_spans(root, nil, [:codespan, :span_html])
117
118
  restore_env(env)
@@ -135,11 +136,11 @@ module Kramdown
135
136
  pipe_on_line = (lines.size > 1 ? false : pipe_on_line) || (lines.last =~ /^#{TABLE_PIPE_CHECK}/)
136
137
  end
137
138
  end
138
- @src.revert_pos(saved_pos) and return false if !pipe_on_line
139
+ @src.revert_pos(saved_pos) and return false unless pipe_on_line
139
140
 
140
- add_container.call(has_footer ? :tfoot : :tbody, false) if !rows.empty?
141
+ add_container.call(has_footer ? :tfoot : :tbody, false) unless rows.empty?
141
142
 
142
- if !table.children.any? {|el| el.type == :tbody}
143
+ if table.children.none? {|el| el.type == :tbody }
143
144
  warning("Found table without body on line #{table.options[:location]} - ignoring it")
144
145
  @src.revert_pos(saved_pos)
145
146
  return false
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -16,7 +16,7 @@ module Kramdown
16
16
  ['<< ', :laquo_space], [' >>', :raquo_space],
17
17
  ['<<', :laquo], ['>>', :raquo]]
18
18
  TYPOGRAPHIC_SYMS_SUBST = Hash[*TYPOGRAPHIC_SYMS.flatten]
19
- TYPOGRAPHIC_SYMS_RE = /#{TYPOGRAPHIC_SYMS.map {|k,v| Regexp.escape(k)}.join('|')}/
19
+ TYPOGRAPHIC_SYMS_RE = /#{TYPOGRAPHIC_SYMS.map {|k, _v| Regexp.escape(k) }.join('|')}/
20
20
 
21
21
  # Parse the typographic symbols at the current location.
22
22
  def parse_typographic_syms
@@ -24,17 +24,17 @@ module Kramdown
24
24
  @src.pos += @src.matched_size
25
25
  val = TYPOGRAPHIC_SYMS_SUBST[@src.matched]
26
26
  if val.kind_of?(Symbol)
27
- @tree.children << Element.new(:typographic_sym, val, nil, :location => start_line_number)
27
+ @tree.children << Element.new(:typographic_sym, val, nil, location: start_line_number)
28
28
  elsif @src.matched == '\\<<'
29
29
  @tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('lt'),
30
- nil, :location => start_line_number)
30
+ nil, location: start_line_number)
31
31
  @tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('lt'),
32
- nil, :location => start_line_number)
32
+ nil, location: start_line_number)
33
33
  else
34
34
  @tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('gt'),
35
- nil, :location => start_line_number)
35
+ nil, location: start_line_number)
36
36
  @tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('gt'),
37
- nil, :location => start_line_number)
37
+ nil, location: start_line_number)
38
38
  end
39
39
  end
40
40
  define_parser(:typographic_syms, TYPOGRAPHIC_SYMS_RE, '--|\\.\\.\\.|(?:\\\\| )?(?:<<|>>)')
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -25,25 +25,26 @@ module Kramdown
25
25
  class Markdown < Kramdown
26
26
 
27
27
  # Array with all the parsing methods that should be removed from the standard kramdown parser.
28
- EXTENDED = [:codeblock_fenced, :table, :definition_list, :footnote_definition, :abbrev_definition, :block_math,
29
- :block_extensions,
28
+ EXTENDED = [:codeblock_fenced, :table, :definition_list, :footnote_definition,
29
+ :abbrev_definition, :block_math, :block_extensions,
30
30
  :footnote_marker, :smart_quotes, :inline_math, :span_extensions, :typographic_syms]
31
31
 
32
32
  def initialize(source, options) # :nodoc:
33
33
  super
34
- @block_parsers.delete_if {|i| EXTENDED.include?(i)}
35
- @span_parsers.delete_if {|i| EXTENDED.include?(i)}
34
+ @block_parsers.delete_if {|i| EXTENDED.include?(i) }
35
+ @span_parsers.delete_if {|i| EXTENDED.include?(i) }
36
36
  end
37
37
 
38
38
  # :stopdoc:
39
39
 
40
40
  BLOCK_BOUNDARY = /#{BLANK_LINE}|#{EOB_MARKER}|\Z/
41
- LAZY_END = /#{BLANK_LINE}|#{EOB_MARKER}|^#{OPT_SPACE}#{LAZY_END_HTML_STOP}|^#{OPT_SPACE}#{LAZY_END_HTML_START}|\Z/
41
+ LAZY_END = /#{BLANK_LINE}|#{EOB_MARKER}|^#{OPT_SPACE}#{LAZY_END_HTML_STOP}|
42
+ ^#{OPT_SPACE}#{LAZY_END_HTML_START}|\Z/x
42
43
  CODEBLOCK_MATCH = /(?:#{BLANK_LINE}?(?:#{INDENT}[ \t]*\S.*\n)+)*/
43
44
  PARAGRAPH_END = LAZY_END
44
45
 
45
46
  IAL_RAND_CHARS = (('a'..'z').to_a + ('0'..'9').to_a)
46
- IAL_RAND_STRING = (1..20).collect {|a| IAL_RAND_CHARS[rand(IAL_RAND_CHARS.size)]}.join
47
+ IAL_RAND_STRING = (1..20).collect { IAL_RAND_CHARS[rand(IAL_RAND_CHARS.size)] }.join
47
48
  LIST_ITEM_IAL = /^\s*(#{IAL_RAND_STRING})?\s*\n/
48
49
  IAL_SPAN_START = LIST_ITEM_IAL
49
50
 
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -17,7 +17,6 @@ module Kramdown
17
17
 
18
18
  autoload :Entities, 'kramdown/utils/entities'
19
19
  autoload :Html, 'kramdown/utils/html'
20
- autoload :OrderedHash, 'kramdown/utils/ordered_hash'
21
20
  autoload :Unidecoder, 'kramdown/utils/unidecoder'
22
21
  autoload :StringScanner, 'kramdown/utils/string_scanner'
23
22
  autoload :Configurable, 'kramdown/utils/configurable'
@@ -25,14 +24,14 @@ module Kramdown
25
24
 
26
25
  # Treat +name+ as if it were snake cased (e.g. snake_case) and camelize it (e.g. SnakeCase).
27
26
  def self.camelize(name)
28
- name.split('_').inject('') {|s,x| s << x[0..0].upcase << x[1..-1] }
27
+ name.split('_').inject(+'') {|s, x| s << x[0..0].upcase << x[1..-1] }
29
28
  end
30
29
 
31
30
  # Treat +name+ as if it were camelized (e.g. CamelizedName) and snake-case it (e.g. camelized_name).
32
31
  def self.snake_case(name)
33
32
  name = name.dup
34
- name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\1_\2')
35
- name.gsub!(/([a-z])([A-Z])/,'\1_\2')
33
+ name.gsub!(/([A-Z]+)([A-Z][a-z])/, '\1_\2')
34
+ name.gsub!(/([a-z])([A-Z])/, '\1_\2')
36
35
  name.downcase!
37
36
  name
38
37
  end
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -26,10 +26,11 @@ module Kramdown
26
26
  # add_<name>(ext_name, data=nil, &block):: Define an extension +ext_name+ by specifying either
27
27
  # the data as argument or by using a block.
28
28
  def configurable(name)
29
- singleton_class = (class << self; self; end)
30
- singleton_class.send(:define_method, :configurables) do
31
- @_configurables ||= Hash.new {|h, k| h[k] = {}}
32
- end unless respond_to?(:configurables)
29
+ unless respond_to?(:configurables)
30
+ singleton_class.send(:define_method, :configurables) do
31
+ @_configurables ||= Hash.new {|h, k| h[k] = {} }
32
+ end
33
+ end
33
34
  singleton_class.send(:define_method, name) do |data|
34
35
  configurables[name][data]
35
36
  end
@@ -1,7 +1,7 @@
1
- # -*- coding: utf-8 -*-
1
+ # -*- coding: utf-8; frozen_string_literal: true -*-
2
2
  #
3
3
  #--
4
- # Copyright (C) 2009-2016 Thomas Leitner <t_leitner@gmx.at>
4
+ # Copyright (C) 2009-2019 Thomas Leitner <t_leitner@gmx.at>
5
5
  #
6
6
  # This file is part of kramdown which is licensed under the MIT.
7
7
  #++
@@ -15,13 +15,11 @@ module Kramdown
15
15
  module Entities
16
16
 
17
17
  # Represents an entity that has a +code_point+ and +name+.
18
- class Entity < Struct.new(:code_point, :name)
19
-
18
+ Entity = Struct.new(:code_point, :name) do
20
19
  # Return the UTF8 representation of the entity.
21
20
  def char
22
21
  [code_point].pack('U*') rescue nil
23
22
  end
24
-
25
23
  end
26
24
 
27
25
  # Array of arrays. Each sub-array specifies a code point and the associated name.
@@ -29,294 +27,294 @@ module Kramdown
29
27
  # This table is not used directly -- Entity objects are automatically created from it and put
30
28
  # into a Hash map when this file is loaded.
31
29
  ENTITY_TABLE = [
32
- [913, 'Alpha'],
33
- [914, 'Beta'],
34
- [915, 'Gamma'],
35
- [916, 'Delta'],
36
- [917, 'Epsilon'],
37
- [918, 'Zeta'],
38
- [919, 'Eta'],
39
- [920, 'Theta'],
40
- [921, 'Iota'],
41
- [922, 'Kappa'],
42
- [923, 'Lambda'],
43
- [924, 'Mu'],
44
- [925, 'Nu'],
45
- [926, 'Xi'],
46
- [927, 'Omicron'],
47
- [928, 'Pi'],
48
- [929, 'Rho'],
49
- [931, 'Sigma'],
50
- [932, 'Tau'],
51
- [933, 'Upsilon'],
52
- [934, 'Phi'],
53
- [935, 'Chi'],
54
- [936, 'Psi'],
55
- [937, 'Omega'],
56
- [945, 'alpha'],
57
- [946, 'beta'],
58
- [947, 'gamma'],
59
- [948, 'delta'],
60
- [949, 'epsilon'],
61
- [950, 'zeta'],
62
- [951, 'eta'],
63
- [952, 'theta'],
64
- [953, 'iota'],
65
- [954, 'kappa'],
66
- [955, 'lambda'],
67
- [956, 'mu'],
68
- [957, 'nu'],
69
- [958, 'xi'],
70
- [959, 'omicron'],
71
- [960, 'pi'],
72
- [961, 'rho'],
73
- [963, 'sigma'],
74
- [964, 'tau'],
75
- [965, 'upsilon'],
76
- [966, 'phi'],
77
- [967, 'chi'],
78
- [968, 'psi'],
79
- [969, 'omega'],
80
- [962, 'sigmaf'],
81
- [977, 'thetasym'],
82
- [978, 'upsih'],
83
- [982, 'piv'],
84
- [8204, 'zwnj'],
85
- [8205, 'zwj'],
86
- [8206, 'lrm'],
87
- [8207, 'rlm'],
88
- [8230, 'hellip'],
89
- [8242, 'prime'],
90
- [8243, 'Prime'],
91
- [8254, 'oline'],
92
- [8260, 'frasl'],
93
- [8472, 'weierp'],
94
- [8465, 'image'],
95
- [8476, 'real'],
96
- [8501, 'alefsym'],
97
- [8226, 'bull'],
98
- [8482, 'trade'],
99
- [8592, 'larr'],
100
- [8594, 'rarr'],
101
- [8593, 'uarr'],
102
- [8595, 'darr'],
103
- [8596, 'harr'],
104
- [8629, 'crarr'],
105
- [8657, 'uArr'],
106
- [8659, 'dArr'],
107
- [8656, 'lArr'],
108
- [8658, 'rArr'],
109
- [8660, 'hArr'],
110
- [8704, 'forall'],
111
- [8706, 'part'],
112
- [8707, 'exist'],
113
- [8709, 'empty'],
114
- [8711, 'nabla'],
115
- [8712, 'isin'],
116
- [8715, 'ni'],
117
- [8713, 'notin'],
118
- [8721, 'sum'],
119
- [8719, 'prod'],
120
- [8722, 'minus'],
121
- [8727, 'lowast'],
122
- [8730, 'radic'],
123
- [8733, 'prop'],
124
- [8734, 'infin'],
125
- [8736, 'ang'],
126
- [8743, 'and'],
127
- [8744, 'or'],
128
- [8745, 'cap'],
129
- [8746, 'cup'],
130
- [8747, 'int'],
131
- [8756, 'there4'],
132
- [8764, 'sim'],
133
- [8776, 'asymp'],
134
- [8773, 'cong'],
135
- [8800, 'ne'],
136
- [8801, 'equiv'],
137
- [8804, 'le'],
138
- [8805, 'ge'],
139
- [8834, 'sub'],
140
- [8835, 'sup'],
141
- [8838, 'sube'],
142
- [8839, 'supe'],
143
- [8836, 'nsub'],
144
- [8853, 'oplus'],
145
- [8855, 'otimes'],
146
- [8869, 'perp'],
147
- [8901, 'sdot'],
148
- [8942, 'vellip'],
149
- [8968, 'rceil'],
150
- [8969, 'lceil'],
151
- [8970, 'lfloor'],
152
- [8971, 'rfloor'],
153
- [9001, 'rang'],
154
- [9002, 'lang'],
155
- [9674, 'loz'],
156
- [9824, 'spades'],
157
- [9827, 'clubs'],
158
- [9829, 'hearts'],
159
- [9830, 'diams'],
160
- [38, 'amp'],
161
- [34, 'quot'],
162
- [39, 'apos'],
163
- [169, 'copy'],
164
- [60, 'lt'],
165
- [62, 'gt'],
166
- [338, 'OElig'],
167
- [339, 'oelig'],
168
- [352, 'Scaron'],
169
- [353, 'scaron'],
170
- [376, 'Yuml'],
171
- [710, 'circ'],
172
- [732, 'tilde'],
173
- [8211, 'ndash'],
174
- [8212, 'mdash'],
175
- [8216, 'lsquo'],
176
- [8217, 'rsquo'],
177
- [8220, 'ldquo'],
178
- [8221, 'rdquo'],
179
- [8224, 'dagger'],
180
- [8225, 'Dagger'],
181
- [8240, 'permil'],
182
- [8364, 'euro'],
183
- [8249, 'lsaquo'],
184
- [8250, 'rsaquo'],
185
- [160, 'nbsp'],
186
- [161, 'iexcl'],
187
- [163, 'pound'],
188
- [164, 'curren'],
189
- [165, 'yen'],
190
- [166, 'brvbar'],
191
- [167, 'sect'],
192
- [168, 'uml'],
193
- [171, 'laquo'],
194
- [187, 'raquo'],
195
- [174, 'reg'],
196
- [170, 'ordf'],
197
- [172, 'not'],
198
- [173, 'shy'],
199
- [175, 'macr'],
200
- [176, 'deg'],
201
- [177, 'plusmn'],
202
- [180, 'acute'],
203
- [181, 'micro'],
204
- [182, 'para'],
205
- [183, 'middot'],
206
- [184, 'cedil'],
207
- [186, 'ordm'],
208
- [162, 'cent'],
209
- [185, 'sup1'],
210
- [178, 'sup2'],
211
- [179, 'sup3'],
212
- [189, 'frac12'],
213
- [188, 'frac14'],
214
- [190, 'frac34'],
215
- [191, 'iquest'],
216
- [192, 'Agrave'],
217
- [193, 'Aacute'],
218
- [194, 'Acirc'],
219
- [195, 'Atilde'],
220
- [196, 'Auml'],
221
- [197, 'Aring'],
222
- [198, 'AElig'],
223
- [199, 'Ccedil'],
224
- [200, 'Egrave'],
225
- [201, 'Eacute'],
226
- [202, 'Ecirc'],
227
- [203, 'Euml'],
228
- [204, 'Igrave'],
229
- [205, 'Iacute'],
230
- [206, 'Icirc'],
231
- [207, 'Iuml'],
232
- [208, 'ETH'],
233
- [209, 'Ntilde'],
234
- [210, 'Ograve'],
235
- [211, 'Oacute'],
236
- [212, 'Ocirc'],
237
- [213, 'Otilde'],
238
- [214, 'Ouml'],
239
- [215, 'times'],
240
- [216, 'Oslash'],
241
- [217, 'Ugrave'],
242
- [218, 'Uacute'],
243
- [219, 'Ucirc'],
244
- [220, 'Uuml'],
245
- [221, 'Yacute'],
246
- [222, 'THORN'],
247
- [223, 'szlig'],
248
- [224, 'agrave'],
249
- [225, 'aacute'],
250
- [226, 'acirc'],
251
- [227, 'atilde'],
252
- [228, 'auml'],
253
- [229, 'aring'],
254
- [230, 'aelig'],
255
- [231, 'ccedil'],
256
- [232, 'egrave'],
257
- [233, 'eacute'],
258
- [234, 'ecirc'],
259
- [235, 'euml'],
260
- [236, 'igrave'],
261
- [237, 'iacute'],
262
- [238, 'icirc'],
263
- [239, 'iuml'],
264
- [240, 'eth'],
265
- [241, 'ntilde'],
266
- [242, 'ograve'],
267
- [243, 'oacute'],
268
- [244, 'ocirc'],
269
- [245, 'otilde'],
270
- [246, 'ouml'],
271
- [247, 'divide'],
272
- [248, 'oslash'],
273
- [249, 'ugrave'],
274
- [250, 'uacute'],
275
- [251, 'ucirc'],
276
- [252, 'uuml'],
277
- [253, 'yacute'],
278
- [254, 'thorn'],
279
- [255, 'yuml'],
30
+ [913, 'Alpha'],
31
+ [914, 'Beta'],
32
+ [915, 'Gamma'],
33
+ [916, 'Delta'],
34
+ [917, 'Epsilon'],
35
+ [918, 'Zeta'],
36
+ [919, 'Eta'],
37
+ [920, 'Theta'],
38
+ [921, 'Iota'],
39
+ [922, 'Kappa'],
40
+ [923, 'Lambda'],
41
+ [924, 'Mu'],
42
+ [925, 'Nu'],
43
+ [926, 'Xi'],
44
+ [927, 'Omicron'],
45
+ [928, 'Pi'],
46
+ [929, 'Rho'],
47
+ [931, 'Sigma'],
48
+ [932, 'Tau'],
49
+ [933, 'Upsilon'],
50
+ [934, 'Phi'],
51
+ [935, 'Chi'],
52
+ [936, 'Psi'],
53
+ [937, 'Omega'],
54
+ [945, 'alpha'],
55
+ [946, 'beta'],
56
+ [947, 'gamma'],
57
+ [948, 'delta'],
58
+ [949, 'epsilon'],
59
+ [950, 'zeta'],
60
+ [951, 'eta'],
61
+ [952, 'theta'],
62
+ [953, 'iota'],
63
+ [954, 'kappa'],
64
+ [955, 'lambda'],
65
+ [956, 'mu'],
66
+ [957, 'nu'],
67
+ [958, 'xi'],
68
+ [959, 'omicron'],
69
+ [960, 'pi'],
70
+ [961, 'rho'],
71
+ [963, 'sigma'],
72
+ [964, 'tau'],
73
+ [965, 'upsilon'],
74
+ [966, 'phi'],
75
+ [967, 'chi'],
76
+ [968, 'psi'],
77
+ [969, 'omega'],
78
+ [962, 'sigmaf'],
79
+ [977, 'thetasym'],
80
+ [978, 'upsih'],
81
+ [982, 'piv'],
82
+ [8204, 'zwnj'],
83
+ [8205, 'zwj'],
84
+ [8206, 'lrm'],
85
+ [8207, 'rlm'],
86
+ [8230, 'hellip'],
87
+ [8242, 'prime'],
88
+ [8243, 'Prime'],
89
+ [8254, 'oline'],
90
+ [8260, 'frasl'],
91
+ [8472, 'weierp'],
92
+ [8465, 'image'],
93
+ [8476, 'real'],
94
+ [8501, 'alefsym'],
95
+ [8226, 'bull'],
96
+ [8482, 'trade'],
97
+ [8592, 'larr'],
98
+ [8594, 'rarr'],
99
+ [8593, 'uarr'],
100
+ [8595, 'darr'],
101
+ [8596, 'harr'],
102
+ [8629, 'crarr'],
103
+ [8657, 'uArr'],
104
+ [8659, 'dArr'],
105
+ [8656, 'lArr'],
106
+ [8658, 'rArr'],
107
+ [8660, 'hArr'],
108
+ [8704, 'forall'],
109
+ [8706, 'part'],
110
+ [8707, 'exist'],
111
+ [8709, 'empty'],
112
+ [8711, 'nabla'],
113
+ [8712, 'isin'],
114
+ [8715, 'ni'],
115
+ [8713, 'notin'],
116
+ [8721, 'sum'],
117
+ [8719, 'prod'],
118
+ [8722, 'minus'],
119
+ [8727, 'lowast'],
120
+ [8730, 'radic'],
121
+ [8733, 'prop'],
122
+ [8734, 'infin'],
123
+ [8736, 'ang'],
124
+ [8743, 'and'],
125
+ [8744, 'or'],
126
+ [8745, 'cap'],
127
+ [8746, 'cup'],
128
+ [8747, 'int'],
129
+ [8756, 'there4'],
130
+ [8764, 'sim'],
131
+ [8776, 'asymp'],
132
+ [8773, 'cong'],
133
+ [8800, 'ne'],
134
+ [8801, 'equiv'],
135
+ [8804, 'le'],
136
+ [8805, 'ge'],
137
+ [8834, 'sub'],
138
+ [8835, 'sup'],
139
+ [8838, 'sube'],
140
+ [8839, 'supe'],
141
+ [8836, 'nsub'],
142
+ [8853, 'oplus'],
143
+ [8855, 'otimes'],
144
+ [8869, 'perp'],
145
+ [8901, 'sdot'],
146
+ [8942, 'vellip'],
147
+ [8968, 'rceil'],
148
+ [8969, 'lceil'],
149
+ [8970, 'lfloor'],
150
+ [8971, 'rfloor'],
151
+ [9001, 'rang'],
152
+ [9002, 'lang'],
153
+ [9674, 'loz'],
154
+ [9824, 'spades'],
155
+ [9827, 'clubs'],
156
+ [9829, 'hearts'],
157
+ [9830, 'diams'],
158
+ [38, 'amp'],
159
+ [34, 'quot'],
160
+ [39, 'apos'],
161
+ [169, 'copy'],
162
+ [60, 'lt'],
163
+ [62, 'gt'],
164
+ [338, 'OElig'],
165
+ [339, 'oelig'],
166
+ [352, 'Scaron'],
167
+ [353, 'scaron'],
168
+ [376, 'Yuml'],
169
+ [710, 'circ'],
170
+ [732, 'tilde'],
171
+ [8211, 'ndash'],
172
+ [8212, 'mdash'],
173
+ [8216, 'lsquo'],
174
+ [8217, 'rsquo'],
175
+ [8220, 'ldquo'],
176
+ [8221, 'rdquo'],
177
+ [8224, 'dagger'],
178
+ [8225, 'Dagger'],
179
+ [8240, 'permil'],
180
+ [8364, 'euro'],
181
+ [8249, 'lsaquo'],
182
+ [8250, 'rsaquo'],
183
+ [160, 'nbsp'],
184
+ [161, 'iexcl'],
185
+ [163, 'pound'],
186
+ [164, 'curren'],
187
+ [165, 'yen'],
188
+ [166, 'brvbar'],
189
+ [167, 'sect'],
190
+ [168, 'uml'],
191
+ [171, 'laquo'],
192
+ [187, 'raquo'],
193
+ [174, 'reg'],
194
+ [170, 'ordf'],
195
+ [172, 'not'],
196
+ [173, 'shy'],
197
+ [175, 'macr'],
198
+ [176, 'deg'],
199
+ [177, 'plusmn'],
200
+ [180, 'acute'],
201
+ [181, 'micro'],
202
+ [182, 'para'],
203
+ [183, 'middot'],
204
+ [184, 'cedil'],
205
+ [186, 'ordm'],
206
+ [162, 'cent'],
207
+ [185, 'sup1'],
208
+ [178, 'sup2'],
209
+ [179, 'sup3'],
210
+ [189, 'frac12'],
211
+ [188, 'frac14'],
212
+ [190, 'frac34'],
213
+ [191, 'iquest'],
214
+ [192, 'Agrave'],
215
+ [193, 'Aacute'],
216
+ [194, 'Acirc'],
217
+ [195, 'Atilde'],
218
+ [196, 'Auml'],
219
+ [197, 'Aring'],
220
+ [198, 'AElig'],
221
+ [199, 'Ccedil'],
222
+ [200, 'Egrave'],
223
+ [201, 'Eacute'],
224
+ [202, 'Ecirc'],
225
+ [203, 'Euml'],
226
+ [204, 'Igrave'],
227
+ [205, 'Iacute'],
228
+ [206, 'Icirc'],
229
+ [207, 'Iuml'],
230
+ [208, 'ETH'],
231
+ [209, 'Ntilde'],
232
+ [210, 'Ograve'],
233
+ [211, 'Oacute'],
234
+ [212, 'Ocirc'],
235
+ [213, 'Otilde'],
236
+ [214, 'Ouml'],
237
+ [215, 'times'],
238
+ [216, 'Oslash'],
239
+ [217, 'Ugrave'],
240
+ [218, 'Uacute'],
241
+ [219, 'Ucirc'],
242
+ [220, 'Uuml'],
243
+ [221, 'Yacute'],
244
+ [222, 'THORN'],
245
+ [223, 'szlig'],
246
+ [224, 'agrave'],
247
+ [225, 'aacute'],
248
+ [226, 'acirc'],
249
+ [227, 'atilde'],
250
+ [228, 'auml'],
251
+ [229, 'aring'],
252
+ [230, 'aelig'],
253
+ [231, 'ccedil'],
254
+ [232, 'egrave'],
255
+ [233, 'eacute'],
256
+ [234, 'ecirc'],
257
+ [235, 'euml'],
258
+ [236, 'igrave'],
259
+ [237, 'iacute'],
260
+ [238, 'icirc'],
261
+ [239, 'iuml'],
262
+ [240, 'eth'],
263
+ [241, 'ntilde'],
264
+ [242, 'ograve'],
265
+ [243, 'oacute'],
266
+ [244, 'ocirc'],
267
+ [245, 'otilde'],
268
+ [246, 'ouml'],
269
+ [247, 'divide'],
270
+ [248, 'oslash'],
271
+ [249, 'ugrave'],
272
+ [250, 'uacute'],
273
+ [251, 'ucirc'],
274
+ [252, 'uuml'],
275
+ [253, 'yacute'],
276
+ [254, 'thorn'],
277
+ [255, 'yuml'],
280
278
 
281
- [8218, 'sbquo'],
282
- [402, 'fnof'],
283
- [8222, 'bdquo'],
279
+ [8218, 'sbquo'],
280
+ [402, 'fnof'],
281
+ [8222, 'bdquo'],
284
282
 
285
- [128, 8364],
286
- [130, 8218],
287
- [131, 402],
288
- [132, 8222],
289
- [133, 8230],
290
- [134, 8224],
291
- [135, 8225],
292
- [136, 710],
293
- [137, 8240],
294
- [138, 352],
295
- [139, 8249],
296
- [140, 338],
297
- [142, 381],
298
- [145, 8216],
299
- [146, 8217],
300
- [147, 8220],
301
- [148, 8221],
302
- [149, 8226],
303
- [150, 8211],
304
- [151, 8212],
305
- [152, 732],
306
- [153, 8482],
307
- [154, 353],
308
- [155, 8250],
309
- [156, 339],
310
- [158, 382],
311
- [159, 376],
283
+ [128, 8364],
284
+ [130, 8218],
285
+ [131, 402],
286
+ [132, 8222],
287
+ [133, 8230],
288
+ [134, 8224],
289
+ [135, 8225],
290
+ [136, 710],
291
+ [137, 8240],
292
+ [138, 352],
293
+ [139, 8249],
294
+ [140, 338],
295
+ [142, 381],
296
+ [145, 8216],
297
+ [146, 8217],
298
+ [147, 8220],
299
+ [148, 8221],
300
+ [149, 8226],
301
+ [150, 8211],
302
+ [151, 8212],
303
+ [152, 732],
304
+ [153, 8482],
305
+ [154, 353],
306
+ [155, 8250],
307
+ [156, 339],
308
+ [158, 382],
309
+ [159, 376],
312
310
 
313
- [8194, 'ensp'],
314
- [8195, 'emsp'],
315
- [8201, 'thinsp'],
316
- ]
311
+ [8194, 'ensp'],
312
+ [8195, 'emsp'],
313
+ [8201, 'thinsp'],
314
+ ]
317
315
 
318
316
  # Contains the mapping of code point (or name) to the actual Entity object.
319
- ENTITY_MAP = Hash.new do |h,k|
317
+ ENTITY_MAP = Hash.new do |h, k|
320
318
  if k.kind_of?(Integer)
321
319
  h[k] = Entity.new(k, nil)
322
320
  else
@@ -344,4 +342,3 @@ module Kramdown
344
342
  end
345
343
 
346
344
  end
347
-