kramdown 1.17.0 → 2.0.0.beta1
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 +4 -2
- data/VERSION +1 -1
- data/bin/kramdown +13 -14
- data/lib/kramdown.rb +2 -2
- data/lib/kramdown/converter.rb +6 -7
- data/lib/kramdown/converter/base.rb +18 -29
- data/lib/kramdown/converter/hash_ast.rb +4 -4
- data/lib/kramdown/converter/html.rb +82 -67
- data/lib/kramdown/converter/kramdown.rb +83 -78
- data/lib/kramdown/converter/latex.rb +53 -47
- data/lib/kramdown/converter/man.rb +22 -25
- data/lib/kramdown/converter/math_engine/mathjax.rb +10 -10
- data/lib/kramdown/converter/remove_html_tags.rb +2 -2
- data/lib/kramdown/converter/syntax_highlighter.rb +2 -2
- data/lib/kramdown/converter/syntax_highlighter/minted.rb +2 -2
- data/lib/kramdown/converter/syntax_highlighter/rouge.rb +5 -5
- data/lib/kramdown/converter/toc.rb +5 -5
- data/lib/kramdown/document.rb +9 -11
- data/lib/kramdown/element.rb +11 -9
- data/lib/kramdown/error.rb +2 -2
- data/lib/kramdown/options.rb +258 -384
- data/lib/kramdown/parser.rb +2 -3
- data/lib/kramdown/parser/base.rb +7 -6
- data/lib/kramdown/parser/html.rb +103 -95
- data/lib/kramdown/parser/kramdown.rb +32 -36
- data/lib/kramdown/parser/kramdown/abbreviation.rb +13 -10
- data/lib/kramdown/parser/kramdown/autolink.rb +3 -3
- data/lib/kramdown/parser/kramdown/blank_line.rb +2 -2
- data/lib/kramdown/parser/kramdown/block_boundary.rb +2 -2
- data/lib/kramdown/parser/kramdown/blockquote.rb +4 -5
- data/lib/kramdown/parser/kramdown/codeblock.rb +4 -5
- data/lib/kramdown/parser/kramdown/codespan.rb +5 -5
- data/lib/kramdown/parser/kramdown/emphasis.rb +6 -6
- data/lib/kramdown/parser/kramdown/eob.rb +2 -2
- data/lib/kramdown/parser/kramdown/escaped_chars.rb +2 -2
- data/lib/kramdown/parser/kramdown/extensions.rb +31 -26
- data/lib/kramdown/parser/kramdown/footnote.rb +7 -6
- data/lib/kramdown/parser/kramdown/header.rb +6 -6
- data/lib/kramdown/parser/kramdown/horizontal_rule.rb +3 -3
- data/lib/kramdown/parser/kramdown/html.rb +31 -26
- data/lib/kramdown/parser/kramdown/html_entity.rb +6 -5
- data/lib/kramdown/parser/kramdown/line_break.rb +3 -3
- data/lib/kramdown/parser/kramdown/link.rb +13 -11
- data/lib/kramdown/parser/kramdown/list.rb +38 -40
- data/lib/kramdown/parser/kramdown/math.rb +4 -5
- data/lib/kramdown/parser/kramdown/paragraph.rb +5 -5
- data/lib/kramdown/parser/kramdown/smart_quotes.rb +23 -23
- data/lib/kramdown/parser/kramdown/table.rb +18 -17
- data/lib/kramdown/parser/kramdown/typographic_symbol.rb +8 -8
- data/lib/kramdown/parser/markdown.rb +9 -8
- data/lib/kramdown/utils.rb +5 -6
- data/lib/kramdown/utils/configurable.rb +7 -6
- data/lib/kramdown/utils/entities.rb +286 -289
- data/lib/kramdown/utils/html.rb +10 -12
- data/lib/kramdown/utils/lru_cache.rb +3 -2
- data/lib/kramdown/utils/string_scanner.rb +2 -3
- data/lib/kramdown/utils/unidecoder.rb +8 -6
- data/lib/kramdown/version.rb +3 -3
- data/man/man1/kramdown.1 +3 -107
- data/test/run_tests.rb +6 -6
- data/test/test_files.rb +122 -298
- data/test/test_location.rb +8 -30
- data/test/test_string_scanner_kramdown.rb +6 -9
- data/test/testcases/block/06_codeblock/highlighting-opts.html +6 -6
- data/test/testcases/block/06_codeblock/highlighting.html +5 -6
- data/test/testcases/block/06_codeblock/with_lang_in_fenced_block.options +1 -1
- data/test/testcases/block/07_horizontal_rule/error.html +2 -2
- data/test/testcases/block/09_html/html5_attributes.html +2 -0
- data/test/testcases/block/09_html/html5_attributes.text +2 -0
- data/test/testcases/block/09_html/html_to_native/typography.html +1 -1
- data/test/testcases/block/09_html/simple.html +1 -1
- data/test/testcases/block/12_extension/options3.html +7 -6
- data/test/testcases/block/12_extension/options3.text +2 -2
- data/test/testcases/span/01_link/inline.html +1 -1
- data/test/testcases/span/01_link/reference.html +3 -3
- data/test/testcases/span/03_codespan/highlighting.html +1 -1
- data/test/testcases/span/text_substitutions/entities_as_char.html +1 -1
- metadata +5 -234
- data/Rakefile +0 -341
- data/benchmark/benchmark.rb +0 -43
- data/benchmark/benchmark.sh +0 -74
- data/benchmark/generate_data.rb +0 -119
- data/benchmark/mdbasics.text +0 -306
- data/benchmark/mdsyntax.text +0 -888
- data/benchmark/testing.sh +0 -12
- data/benchmark/timing.sh +0 -10
- data/doc/_design.scss +0 -441
- data/doc/bg.png +0 -0
- data/doc/default.scss +0 -217
- data/doc/default.template +0 -62
- data/doc/documentation.page +0 -84
- data/doc/documentation.template +0 -36
- data/doc/index.page +0 -113
- data/doc/installation.page +0 -88
- data/doc/links.markdown +0 -6
- data/doc/metainfo +0 -13
- data/doc/news.feed +0 -9
- data/doc/news.page +0 -29
- data/doc/options.page +0 -49
- data/doc/quickref.page +0 -603
- data/doc/sidebar.template +0 -22
- data/doc/sitemap.sitemap +0 -5
- data/doc/syntax.page +0 -1799
- data/doc/tests.page +0 -104
- data/doc/virtual +0 -14
- data/lib/kramdown/converter/math_engine/itex2mml.rb +0 -39
- data/lib/kramdown/converter/math_engine/katex.rb +0 -35
- data/lib/kramdown/converter/math_engine/mathjaxnode.rb +0 -56
- data/lib/kramdown/converter/math_engine/ritex.rb +0 -38
- data/lib/kramdown/converter/math_engine/sskatex.rb +0 -97
- data/lib/kramdown/converter/pdf.rb +0 -625
- data/lib/kramdown/converter/syntax_highlighter/coderay.rb +0 -81
- data/lib/kramdown/parser/gfm.rb +0 -188
- data/lib/kramdown/utils/ordered_hash.rb +0 -18
- data/setup.rb +0 -1585
- data/test/testcases/block/07_horizontal_rule/error.html.19 +0 -7
- data/test/testcases/block/09_html/html_to_native/typography.html.19 +0 -1
- data/test/testcases/block/09_html/simple.html.19 +0 -60
- data/test/testcases/block/15_math/itex2mml.html +0 -1
- data/test/testcases/block/15_math/itex2mml.options +0 -1
- data/test/testcases/block/15_math/itex2mml.text +0 -1
- data/test/testcases/block/15_math/katex.html.19 +0 -2
- data/test/testcases/block/15_math/katex.options +0 -1
- data/test/testcases/block/15_math/katex.text +0 -2
- data/test/testcases/block/15_math/mathjaxnode.html.19 +0 -27
- data/test/testcases/block/15_math/mathjaxnode.options +0 -1
- data/test/testcases/block/15_math/mathjaxnode.text +0 -1
- data/test/testcases/block/15_math/mathjaxnode_notexhints.html.19 +0 -23
- data/test/testcases/block/15_math/mathjaxnode_notexhints.options +0 -3
- data/test/testcases/block/15_math/mathjaxnode_notexhints.text +0 -1
- data/test/testcases/block/15_math/mathjaxnode_semantics.html.19 +0 -32
- data/test/testcases/block/15_math/mathjaxnode_semantics.options +0 -3
- data/test/testcases/block/15_math/mathjaxnode_semantics.text +0 -1
- data/test/testcases/block/15_math/ritex.html +0 -1
- data/test/testcases/block/15_math/ritex.options +0 -1
- data/test/testcases/block/15_math/ritex.text +0 -1
- data/test/testcases/block/15_math/sskatex.html.19 +0 -2
- data/test/testcases/block/15_math/sskatex.options +0 -1
- data/test/testcases/block/15_math/sskatex.text +0 -2
- data/test/testcases/span/01_link/inline.html.19 +0 -46
- data/test/testcases/span/01_link/reference.html.19 +0 -37
- data/test/testcases/span/math/itex2mml.html +0 -1
- data/test/testcases/span/math/itex2mml.options +0 -1
- data/test/testcases/span/math/itex2mml.text +0 -1
- data/test/testcases/span/math/katex.html.19 +0 -1
- data/test/testcases/span/math/katex.options +0 -1
- data/test/testcases/span/math/katex.text +0 -1
- data/test/testcases/span/math/mathjaxnode.html.19 +0 -27
- data/test/testcases/span/math/mathjaxnode.options +0 -1
- data/test/testcases/span/math/mathjaxnode.text +0 -1
- data/test/testcases/span/math/ritex.html +0 -1
- data/test/testcases/span/math/ritex.options +0 -1
- data/test/testcases/span/math/ritex.text +0 -1
- data/test/testcases/span/math/sskatex.html.19 +0 -1
- data/test/testcases/span/math/sskatex.options +0 -1
- data/test/testcases/span/math/sskatex.text +0 -1
- data/test/testcases/span/text_substitutions/entities_as_char.html.19 +0 -1
- data/test/testcases_gfm/atx_header.html +0 -3
- data/test/testcases_gfm/atx_header.text +0 -3
- data/test/testcases_gfm/backticks_disable_highlighting.html +0 -2
- data/test/testcases_gfm/backticks_disable_highlighting.options +0 -1
- data/test/testcases_gfm/backticks_disable_highlighting.text +0 -3
- data/test/testcases_gfm/backticks_syntax.html +0 -20
- data/test/testcases_gfm/backticks_syntax.text +0 -19
- data/test/testcases_gfm/codeblock_fenced.html +0 -20
- data/test/testcases_gfm/codeblock_fenced.options +0 -1
- data/test/testcases_gfm/codeblock_fenced.text +0 -21
- data/test/testcases_gfm/hard_line_breaks.html +0 -3
- data/test/testcases_gfm/hard_line_breaks.text +0 -3
- data/test/testcases_gfm/hard_line_breaks_off.html +0 -2
- data/test/testcases_gfm/hard_line_breaks_off.options +0 -1
- data/test/testcases_gfm/hard_line_breaks_off.text +0 -2
- data/test/testcases_gfm/header_ids.html +0 -27
- data/test/testcases_gfm/header_ids.html.19 +0 -27
- data/test/testcases_gfm/header_ids.options +0 -1
- data/test/testcases_gfm/header_ids.text +0 -27
- data/test/testcases_gfm/header_ids_with_prefix.html +0 -3
- data/test/testcases_gfm/header_ids_with_prefix.options +0 -2
- data/test/testcases_gfm/header_ids_with_prefix.text +0 -3
- data/test/testcases_gfm/no_typographic.html +0 -3
- data/test/testcases_gfm/no_typographic.html.19 +0 -3
- data/test/testcases_gfm/no_typographic.options +0 -1
- data/test/testcases_gfm/no_typographic.text +0 -3
- data/test/testcases_gfm/paragraph_end-disabled.html +0 -31
- data/test/testcases_gfm/paragraph_end-disabled.options +0 -1
- data/test/testcases_gfm/paragraph_end-disabled.text +0 -27
- data/test/testcases_gfm/paragraph_end.html +0 -38
- data/test/testcases_gfm/paragraph_end.text +0 -27
- data/test/testcases_gfm/strikethrough.html +0 -27
- data/test/testcases_gfm/strikethrough.html.19 +0 -27
- data/test/testcases_gfm/strikethrough.text +0 -27
- data/test/testcases_gfm/task_list.html +0 -40
- data/test/testcases_gfm/task_list.text +0 -26
- data/test/testcases_gfm/two_para_hard_line_breaks.html +0 -4
- 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-
|
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, :
|
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, :
|
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-
|
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
|
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
|
-
|
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, :
|
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-
|
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
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
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
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
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,
|
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, :
|
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-
|
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
|
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, :
|
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
|
-
|
47
|
-
break
|
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) ||
|
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)
|
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
|
70
|
+
if i.odd?
|
70
71
|
(cells.empty? ? cells : cells.last) << str
|
71
72
|
else
|
72
|
-
reset_env(:
|
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
|
-
|
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(:
|
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
|
139
|
+
@src.revert_pos(saved_pos) and return false unless pipe_on_line
|
139
140
|
|
140
|
-
add_container.call(has_footer ? :tfoot : :tbody, false)
|
141
|
+
add_container.call(has_footer ? :tfoot : :tbody, false) unless rows.empty?
|
141
142
|
|
142
|
-
if
|
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-
|
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,
|
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, :
|
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, :
|
30
|
+
nil, location: start_line_number)
|
31
31
|
@tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('lt'),
|
32
|
-
nil, :
|
32
|
+
nil, location: start_line_number)
|
33
33
|
else
|
34
34
|
@tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('gt'),
|
35
|
-
nil, :
|
35
|
+
nil, location: start_line_number)
|
36
36
|
@tree.children << Element.new(:entity, ::Kramdown::Utils::Entities.entity('gt'),
|
37
|
-
nil, :
|
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-
|
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,
|
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}
|
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 {
|
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
|
|
data/lib/kramdown/utils.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
# -*- coding: utf-8 -*-
|
1
|
+
# -*- coding: utf-8; frozen_string_literal: true -*-
|
2
2
|
#
|
3
3
|
#--
|
4
|
-
# Copyright (C) 2009-
|
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-
|
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
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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-
|
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
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
273
|
-
|
274
|
-
|
275
|
-
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
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
|
-
|
282
|
-
|
283
|
-
|
279
|
+
[8218, 'sbquo'],
|
280
|
+
[402, 'fnof'],
|
281
|
+
[8222, 'bdquo'],
|
284
282
|
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
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
|
-
|
314
|
-
|
315
|
-
|
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
|
-
|