kramdown 2.0.0.beta2 → 2.3.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.
- checksums.yaml +4 -4
- data/CONTRIBUTERS +14 -3
- data/VERSION +1 -1
- data/bin/kramdown +48 -19
- data/lib/kramdown/converter/base.rb +2 -1
- data/lib/kramdown/converter/html.rb +47 -25
- data/lib/kramdown/converter/kramdown.rb +11 -6
- data/lib/kramdown/converter/latex.rb +1 -1
- data/lib/kramdown/converter/math_engine/mathjax.rb +7 -33
- data/lib/kramdown/converter/syntax_highlighter.rb +1 -1
- data/lib/kramdown/converter/syntax_highlighter/rouge.rb +20 -9
- data/lib/kramdown/element.rb +30 -3
- data/lib/kramdown/options.rb +57 -8
- data/lib/kramdown/parser/base.rb +3 -1
- data/lib/kramdown/parser/html.rb +8 -8
- data/lib/kramdown/parser/kramdown.rb +11 -2
- data/lib/kramdown/parser/kramdown/autolink.rb +2 -2
- data/lib/kramdown/parser/kramdown/blank_line.rb +2 -2
- data/lib/kramdown/parser/kramdown/block_boundary.rb +3 -2
- data/lib/kramdown/parser/kramdown/codespan.rb +12 -2
- data/lib/kramdown/parser/kramdown/emphasis.rb +1 -1
- data/lib/kramdown/parser/kramdown/extensions.rb +14 -8
- data/lib/kramdown/parser/kramdown/header.rb +3 -2
- data/lib/kramdown/parser/kramdown/html.rb +4 -10
- data/lib/kramdown/parser/kramdown/link.rb +3 -2
- data/lib/kramdown/parser/kramdown/list.rb +64 -33
- data/lib/kramdown/parser/kramdown/math.rb +1 -1
- data/lib/kramdown/parser/kramdown/paragraph.rb +3 -3
- data/lib/kramdown/parser/kramdown/table.rb +3 -3
- data/lib/kramdown/utils/html.rb +9 -0
- data/lib/kramdown/version.rb +1 -1
- data/man/man1/kramdown.1 +31 -1
- data/test/test_files.rb +18 -11
- data/test/test_location.rb +2 -2
- data/test/test_string_scanner_kramdown.rb +1 -1
- data/test/testcases/block/03_paragraph/standalone_image.html +8 -0
- data/test/testcases/block/03_paragraph/standalone_image.text +6 -0
- data/test/testcases/block/04_header/atx_header.html +6 -0
- data/test/testcases/block/04_header/atx_header.text +6 -0
- data/test/testcases/block/06_codeblock/guess_lang_css_class.html +15 -0
- data/test/testcases/block/06_codeblock/guess_lang_css_class.options +2 -0
- data/test/testcases/block/06_codeblock/guess_lang_css_class.text +13 -0
- data/test/testcases/block/09_html/processing_instruction.html +5 -6
- data/test/testcases/block/09_html/standalone_image_in_div.htmlinput +7 -0
- data/test/testcases/block/09_html/standalone_image_in_div.text +8 -0
- data/test/testcases/block/12_extension/options.html +4 -4
- data/test/testcases/block/12_extension/options.text +2 -0
- data/test/testcases/block/12_extension/options2.html +4 -4
- data/test/testcases/block/14_table/table_with_footnote.html +4 -4
- data/test/testcases/block/15_math/gh_128.html +1 -2
- data/test/testcases/block/15_math/normal.html +16 -15
- data/test/testcases/block/16_toc/toc_with_footnotes.html +4 -4
- data/test/testcases/cjk-line-break.html +4 -0
- data/test/testcases/cjk-line-break.options +1 -0
- data/test/testcases/cjk-line-break.text +12 -0
- data/test/testcases/span/02_emphasis/normal.html +4 -0
- data/test/testcases/span/02_emphasis/normal.text +4 -0
- data/test/testcases/span/03_codespan/normal-css-class.html +1 -0
- data/test/testcases/span/03_codespan/normal-css-class.options +2 -0
- data/test/testcases/span/03_codespan/normal-css-class.text +1 -0
- data/test/testcases/span/04_footnote/backlink_inline.html +21 -21
- data/test/testcases/span/04_footnote/backlink_text.html +4 -4
- data/test/testcases/span/04_footnote/footnote_nr.html +6 -6
- data/test/testcases/span/04_footnote/footnote_prefix.html +12 -0
- data/test/testcases/span/04_footnote/footnote_prefix.options +1 -0
- data/test/testcases/span/04_footnote/footnote_prefix.text +4 -0
- data/test/testcases/span/04_footnote/inside_footnote.html +9 -9
- data/test/testcases/span/04_footnote/markers.html +16 -16
- data/test/testcases/span/04_footnote/placement.html +4 -4
- data/test/testcases/span/04_footnote/regexp_problem.html +4 -4
- data/test/testcases/span/04_footnote/without_backlink.html +3 -3
- data/test/testcases/span/05_html/normal.html +1 -1
- data/test/testcases/span/abbreviations/in_footnote.html +4 -4
- data/test/testcases/span/math/normal.html +4 -4
- metadata +35 -15
- data/test/testcases/block/15_math/mathjax_preview.html +0 -4
- data/test/testcases/block/15_math/mathjax_preview.options +0 -2
- data/test/testcases/block/15_math/mathjax_preview.text +0 -5
- data/test/testcases/block/15_math/mathjax_preview_as_code.html +0 -4
- data/test/testcases/block/15_math/mathjax_preview_as_code.options +0 -3
- data/test/testcases/block/15_math/mathjax_preview_as_code.text +0 -5
- data/test/testcases/block/15_math/mathjax_preview_simple.html +0 -4
- data/test/testcases/block/15_math/mathjax_preview_simple.options +0 -2
- data/test/testcases/block/15_math/mathjax_preview_simple.text +0 -5
@@ -21,7 +21,7 @@ describe Kramdown::Utils::StringScanner do
|
|
21
21
|
it "computes the correct current_line_number for example ##{i + 1}" do
|
22
22
|
str_sc = Kramdown::Utils::StringScanner.new(test_string)
|
23
23
|
scan_regexes.each {|scan_re| str_sc.scan_until(scan_re) }
|
24
|
-
str_sc.current_line_number
|
24
|
+
assert_equal(expect, str_sc.current_line_number)
|
25
25
|
end
|
26
26
|
end
|
27
27
|
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class Foo
|
2
|
+
def bar
|
3
|
+
puts 'Hello'
|
4
|
+
end
|
5
|
+
end
|
6
|
+
</code></pre>
|
7
|
+
</div></div>
|
8
|
+
|
9
|
+
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>class Foo
|
10
|
+
def bar
|
11
|
+
puts 'Hello'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
</code></pre>
|
15
|
+
</div></div>
|
@@ -1,13 +1,12 @@
|
|
1
|
-
|
1
|
+
<p><?xml version=”1.0”?></p>
|
2
2
|
|
3
3
|
<p>para</p>
|
4
4
|
|
5
|
-
|
6
|
-
<p>para</p>
|
5
|
+
<p><? test ?> para</p>
|
7
6
|
|
8
7
|
<p>other</p>
|
9
8
|
|
10
|
-
|
11
|
-
multiline
|
9
|
+
<p><?
|
10
|
+
multiline <em>text</em>
|
12
11
|
is allowed
|
13
|
-
|
12
|
+
?></p>
|
@@ -10,12 +10,12 @@ some *para*
|
|
10
10
|
<p>some <span><em>para</em></span></p>
|
11
11
|
</div>
|
12
12
|
|
13
|
-
<p>Some text<sup id="fnref:ab"><a href="#fn:ab" class="footnote">10</a></sup>.</p>
|
13
|
+
<p>Some text<sup id="fnref:ab" role="doc-noteref"><a href="#fn:ab" class="footnote">10</a></sup>.</p>
|
14
14
|
|
15
|
-
<div class="footnotes">
|
15
|
+
<div class="footnotes" role="doc-endnotes">
|
16
16
|
<ol start="10">
|
17
|
-
<li id="fn:ab">
|
18
|
-
<p>Some text. <a href="#fnref:ab" class="reversefootnote">↩</a></p>
|
17
|
+
<li id="fn:ab" role="doc-endnote">
|
18
|
+
<p>Some text. <a href="#fnref:ab" class="reversefootnote" role="doc-backlink">↩</a></p>
|
19
19
|
</li>
|
20
20
|
</ol>
|
21
21
|
</div>
|
@@ -1,10 +1,10 @@
|
|
1
1
|
|
2
|
-
<p>Some text<sup id="fnref:ab"><a href="#fn:ab" class="footnote">1</a></sup>.</p>
|
2
|
+
<p>Some text<sup id="fnref:ab" role="doc-noteref"><a href="#fn:ab" class="footnote">1</a></sup>.</p>
|
3
3
|
|
4
|
-
<div class="footnotes">
|
4
|
+
<div class="footnotes" role="doc-endnotes">
|
5
5
|
<ol>
|
6
|
-
<li id="fn:ab">
|
7
|
-
<p>Some text. <a href="#fnref:ab" class="reversefootnote">↩</a></p>
|
6
|
+
<li id="fn:ab" role="doc-endnote">
|
7
|
+
<p>Some text. <a href="#fnref:ab" class="reversefootnote" role="doc-backlink">↩</a></p>
|
8
8
|
</li>
|
9
9
|
</ol>
|
10
10
|
</div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<table>
|
2
2
|
<tbody>
|
3
3
|
<tr>
|
4
|
-
<td>this is <sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup></td>
|
4
|
+
<td>this is <sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote">1</a></sup></td>
|
5
5
|
<td>a table</td>
|
6
6
|
</tr>
|
7
7
|
<tr>
|
@@ -11,15 +11,15 @@
|
|
11
11
|
</tbody>
|
12
12
|
</table>
|
13
13
|
|
14
|
-
<div class="footnotes">
|
14
|
+
<div class="footnotes" role="doc-endnotes">
|
15
15
|
<ol>
|
16
|
-
<li id="fn:1">
|
16
|
+
<li id="fn:1" role="doc-endnote">
|
17
17
|
<p>Something</p>
|
18
18
|
|
19
19
|
<blockquote>
|
20
20
|
<p>special here</p>
|
21
21
|
</blockquote>
|
22
|
-
<p><a href="#fnref:1" class="reversefootnote">↩</a></p>
|
22
|
+
<p><a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
|
23
23
|
</li>
|
24
24
|
</ol>
|
25
25
|
</div>
|
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
alert('a') alert('b<') %]]></script>
|
1
|
+
\[<script>alert('a')</script> <script>alert('b<')</script>\]
|
@@ -1,29 +1,30 @@
|
|
1
1
|
<p>This is a para.
|
2
|
-
|
2
|
+
\(\text{LaTeX} \lambda_5\)</p>
|
3
3
|
|
4
|
-
|
4
|
+
\[\lambda_5 = \alpha + 4\]
|
5
5
|
|
6
|
-
<p
|
6
|
+
<p>\(\lambda_\alpha > 5\)
|
7
7
|
This is a para.</p>
|
8
8
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
\end{align*} %]]></script>
|
9
|
+
\[\begin{align*}
|
10
|
+
&=5 \\
|
11
|
+
&=6 \\
|
12
|
+
\end{align*}\]
|
14
13
|
|
15
|
-
|
14
|
+
\[5+5\]
|
16
15
|
|
17
|
-
|
16
|
+
\[5+5\]
|
18
17
|
|
19
|
-
|
18
|
+
\[5+5\]
|
20
19
|
|
21
|
-
|
20
|
+
\[5+5\]
|
22
21
|
|
23
22
|
<pre><code>$$5+5$$
|
24
23
|
</code></pre>
|
25
24
|
|
26
|
-
<
|
27
|
-
|
25
|
+
<div class="cls">\[5+5\]
|
26
|
+
</div>
|
27
|
+
<div class="cls">\[5+5\]
|
28
|
+
</div>
|
28
29
|
|
29
|
-
|
30
|
+
\[|x| = 5\]
|
@@ -2,12 +2,12 @@
|
|
2
2
|
<li><a href="#header1-level-1" id="markdown-toc-header1-level-1">Header level 1</a></li>
|
3
3
|
</ul>
|
4
4
|
|
5
|
-
<h1 id="header1-level-1">Header<sup id="fnref:1"><a href="#fn:1" class="footnote">1</a></sup> level 1</h1>
|
5
|
+
<h1 id="header1-level-1">Header<sup id="fnref:1" role="doc-noteref"><a href="#fn:1" class="footnote">1</a></sup> level 1</h1>
|
6
6
|
|
7
|
-
<div class="footnotes">
|
7
|
+
<div class="footnotes" role="doc-endnotes">
|
8
8
|
<ol>
|
9
|
-
<li id="fn:1">
|
10
|
-
<p>Some footnote content here <a href="#fnref:1" class="reversefootnote">↩</a></p>
|
9
|
+
<li id="fn:1" role="doc-endnote">
|
10
|
+
<p>Some footnote content here <a href="#fnref:1" class="reversefootnote" role="doc-backlink">↩</a></p>
|
11
11
|
</li>
|
12
12
|
</ol>
|
13
13
|
</div>
|
@@ -0,0 +1 @@
|
|
1
|
+
:remove_line_breaks_for_cjk: true
|
@@ -0,0 +1 @@
|
|
1
|
+
<p>This is a <code class="highlighter-rouge">code-span</code></p>
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a `code-span`
|
@@ -1,30 +1,30 @@
|
|
1
|
-
<p>This is <sup id="fnref:paragraph"><a href="#fn:paragraph" class="footnote">1</a></sup><sup id="fnref:header"><a href="#fn:header" class="footnote">2</a></sup><sup id="fnref:blockquote"><a href="#fn:blockquote" class="footnote">3</a></sup><sup id="fnref:codeblock"><a href="#fn:codeblock" class="footnote">4</a></sup><sup id="fnref:list"><a href="#fn:list" class="footnote">5</a></sup><sup id="fnref:table"><a href="#fn:table" class="footnote">6</a></sup><sup id="fnref:hrule"><a href="#fn:hrule" class="footnote">7</a></sup><sup id="fnref:mathblock"><a href="#fn:mathblock" class="footnote">8</a></sup><sup id="fnref:html"><a href="#fn:html" class="footnote">9</a></sup></p>
|
1
|
+
<p>This is <sup id="fnref:paragraph" role="doc-noteref"><a href="#fn:paragraph" class="footnote">1</a></sup><sup id="fnref:header" role="doc-noteref"><a href="#fn:header" class="footnote">2</a></sup><sup id="fnref:blockquote" role="doc-noteref"><a href="#fn:blockquote" class="footnote">3</a></sup><sup id="fnref:codeblock" role="doc-noteref"><a href="#fn:codeblock" class="footnote">4</a></sup><sup id="fnref:list" role="doc-noteref"><a href="#fn:list" class="footnote">5</a></sup><sup id="fnref:table" role="doc-noteref"><a href="#fn:table" class="footnote">6</a></sup><sup id="fnref:hrule" role="doc-noteref"><a href="#fn:hrule" class="footnote">7</a></sup><sup id="fnref:mathblock" role="doc-noteref"><a href="#fn:mathblock" class="footnote">8</a></sup><sup id="fnref:html" role="doc-noteref"><a href="#fn:html" class="footnote">9</a></sup></p>
|
2
2
|
|
3
|
-
<div class="footnotes">
|
3
|
+
<div class="footnotes" role="doc-endnotes">
|
4
4
|
<ol>
|
5
|
-
<li id="fn:paragraph">
|
5
|
+
<li id="fn:paragraph" role="doc-endnote">
|
6
6
|
|
7
|
-
<p>A paragraph <a href="#fnref:paragraph" class="reversefootnote">↩</a></p>
|
7
|
+
<p>A paragraph <a href="#fnref:paragraph" class="reversefootnote" role="doc-backlink">↩</a></p>
|
8
8
|
</li>
|
9
|
-
<li id="fn:header">
|
9
|
+
<li id="fn:header" role="doc-endnote">
|
10
10
|
|
11
|
-
<h1 id="a-header">A header <a href="#fnref:header" class="reversefootnote">↩</a></h1>
|
11
|
+
<h1 id="a-header">A header <a href="#fnref:header" class="reversefootnote" role="doc-backlink">↩</a></h1>
|
12
12
|
</li>
|
13
|
-
<li id="fn:blockquote">
|
13
|
+
<li id="fn:blockquote" role="doc-endnote">
|
14
14
|
|
15
15
|
<blockquote>
|
16
16
|
<p>blockquote</p>
|
17
17
|
|
18
|
-
<p>paragraph <a href="#fnref:blockquote" class="reversefootnote">↩</a></p>
|
18
|
+
<p>paragraph <a href="#fnref:blockquote" class="reversefootnote" role="doc-backlink">↩</a></p>
|
19
19
|
</blockquote>
|
20
20
|
</li>
|
21
|
-
<li id="fn:codeblock">
|
21
|
+
<li id="fn:codeblock" role="doc-endnote">
|
22
22
|
|
23
23
|
<pre><code>codeblock
|
24
24
|
</code></pre>
|
25
|
-
<p><a href="#fnref:codeblock" class="reversefootnote">↩</a></p>
|
25
|
+
<p><a href="#fnref:codeblock" class="reversefootnote" role="doc-backlink">↩</a></p>
|
26
26
|
</li>
|
27
|
-
<li id="fn:list">
|
27
|
+
<li id="fn:list" role="doc-endnote">
|
28
28
|
|
29
29
|
<ul>
|
30
30
|
<li>item 1</li>
|
@@ -36,14 +36,14 @@
|
|
36
36
|
<blockquote>
|
37
37
|
<p>blockquote</p>
|
38
38
|
|
39
|
-
<h1 id="header">header <a href="#fnref:list" class="reversefootnote">↩</a></h1>
|
39
|
+
<h1 id="header">header <a href="#fnref:list" class="reversefootnote" role="doc-backlink">↩</a></h1>
|
40
40
|
</blockquote>
|
41
41
|
</li>
|
42
42
|
</ul>
|
43
43
|
</li>
|
44
44
|
</ul>
|
45
45
|
</li>
|
46
|
-
<li id="fn:table">
|
46
|
+
<li id="fn:table" role="doc-endnote">
|
47
47
|
|
48
48
|
<table>
|
49
49
|
<tbody>
|
@@ -57,23 +57,23 @@
|
|
57
57
|
</tr>
|
58
58
|
</tbody>
|
59
59
|
</table>
|
60
|
-
<p><a href="#fnref:table" class="reversefootnote">↩</a></p>
|
60
|
+
<p><a href="#fnref:table" class="reversefootnote" role="doc-backlink">↩</a></p>
|
61
61
|
</li>
|
62
|
-
<li id="fn:hrule">
|
62
|
+
<li id="fn:hrule" role="doc-endnote">
|
63
63
|
|
64
64
|
<hr />
|
65
|
-
<p><a href="#fnref:hrule" class="reversefootnote">↩</a></p>
|
65
|
+
<p><a href="#fnref:hrule" class="reversefootnote" role="doc-backlink">↩</a></p>
|
66
66
|
</li>
|
67
|
-
<li id="fn:mathblock">
|
67
|
+
<li id="fn:mathblock" role="doc-endnote">
|
68
68
|
|
69
|
-
|
70
|
-
<p><a href="#fnref:mathblock" class="reversefootnote">↩</a></p>
|
69
|
+
\[x + 2\]
|
70
|
+
<p><a href="#fnref:mathblock" class="reversefootnote" role="doc-backlink">↩</a></p>
|
71
71
|
</li>
|
72
|
-
<li id="fn:html">
|
72
|
+
<li id="fn:html" role="doc-endnote">
|
73
73
|
|
74
74
|
<div>test
|
75
75
|
</div>
|
76
|
-
<p><a href="#fnref:html" class="reversefootnote">↩</a></p>
|
76
|
+
<p><a href="#fnref:html" class="reversefootnote" role="doc-backlink">↩</a></p>
|
77
77
|
</li>
|
78
78
|
</ol>
|
79
79
|
</div>
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<p>Some footnote here<sup id="fnref:fn"><a href="#fn:fn" class="footnote">1</a></sup></p>
|
1
|
+
<p>Some footnote here<sup id="fnref:fn" role="doc-noteref"><a href="#fn:fn" class="footnote">1</a></sup></p>
|
2
2
|
|
3
|
-
<div class="footnotes">
|
3
|
+
<div class="footnotes" role="doc-endnotes">
|
4
4
|
<ol>
|
5
|
-
<li id="fn:fn">
|
6
|
-
<p>Some text here <a href="#fnref:fn" class="reversefootnote">text &8617; <img /></a></p>
|
5
|
+
<li id="fn:fn" role="doc-endnote">
|
6
|
+
<p>Some text here <a href="#fnref:fn" class="reversefootnote" role="doc-backlink">text &8617; <img /></a></p>
|
7
7
|
</li>
|
8
8
|
</ol>
|
9
9
|
</div>
|
@@ -1,12 +1,12 @@
|
|
1
|
-
<p>This is a footnote<sup id="fnref:ab"><a href="#fn:ab" class="footnote">35</a></sup>. And another<sup id="fnref:bc"><a href="#fn:bc" class="footnote">36</a></sup>.</p>
|
1
|
+
<p>This is a footnote<sup id="fnref:ab" role="doc-noteref"><a href="#fn:ab" class="footnote">35</a></sup>. And another<sup id="fnref:bc" role="doc-noteref"><a href="#fn:bc" class="footnote">36</a></sup>.</p>
|
2
2
|
|
3
|
-
<div class="footnotes">
|
3
|
+
<div class="footnotes" role="doc-endnotes">
|
4
4
|
<ol start="35">
|
5
|
-
<li id="fn:ab">
|
6
|
-
<p>Some text. <a href="#fnref:ab" class="reversefootnote">↩</a></p>
|
5
|
+
<li id="fn:ab" role="doc-endnote">
|
6
|
+
<p>Some text. <a href="#fnref:ab" class="reversefootnote" role="doc-backlink">↩</a></p>
|
7
7
|
</li>
|
8
|
-
<li id="fn:bc">
|
9
|
-
<p>Some other text. <a href="#fnref:bc" class="reversefootnote">↩</a></p>
|
8
|
+
<li id="fn:bc" role="doc-endnote">
|
9
|
+
<p>Some other text. <a href="#fnref:bc" class="reversefootnote" role="doc-backlink">↩</a></p>
|
10
10
|
</li>
|
11
11
|
</ol>
|
12
12
|
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<p>This is a<sup id="fnref:adf123-ab" role="doc-noteref"><a href="#fn:adf123-ab" class="footnote">1</a></sup> footnote<sup id="fnref:adf123-ab:1" role="doc-noteref"><a href="#fn:adf123-ab" class="footnote">1</a></sup>. And another<sup id="fnref:adf123-bc" role="doc-noteref"><a href="#fn:adf123-bc" class="footnote">2</a></sup>.</p>
|
2
|
+
|
3
|
+
<div class="footnotes" role="doc-endnotes">
|
4
|
+
<ol>
|
5
|
+
<li id="fn:adf123-ab" role="doc-endnote">
|
6
|
+
<p>Some text. <a href="#fnref:adf123-ab" class="reversefootnote" role="doc-backlink">↩</a> <a href="#fnref:adf123-ab:1" class="reversefootnote" role="doc-backlink">↩<sup>2</sup></a></p>
|
7
|
+
</li>
|
8
|
+
<li id="fn:adf123-bc" role="doc-endnote">
|
9
|
+
<p>Some other text. <a href="#fnref:adf123-bc" class="reversefootnote" role="doc-backlink">↩</a></p>
|
10
|
+
</li>
|
11
|
+
</ol>
|
12
|
+
</div>
|