kramdown 0.11.0 → 0.12.0

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

Potentially problematic release.


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

Files changed (94) hide show
  1. data/CONTRIBUTERS +1 -1
  2. data/ChangeLog +532 -0
  3. data/README +22 -12
  4. data/Rakefile +9 -8
  5. data/VERSION +1 -1
  6. data/benchmark/benchmark.sh +61 -0
  7. data/benchmark/generate_data.rb +57 -55
  8. data/benchmark/testing.sh +1 -1
  9. data/benchmark/timing.sh +3 -3
  10. data/bin/kramdown +1 -2
  11. data/data/kramdown/document.html +2 -2
  12. data/data/kramdown/document.latex +2 -2
  13. data/doc/default.scss.css +6 -1
  14. data/doc/default.template +1 -1
  15. data/doc/documentation.page +1 -1
  16. data/doc/index.page +9 -7
  17. data/doc/installation.page +2 -3
  18. data/doc/links.markdown +1 -1
  19. data/doc/quickref.page +19 -19
  20. data/doc/syntax.page +117 -98
  21. data/doc/tests.page +8 -7
  22. data/lib/kramdown/compatibility.rb +2 -1
  23. data/lib/kramdown/converter.rb +5 -7
  24. data/lib/kramdown/converter/base.rb +87 -32
  25. data/lib/kramdown/converter/html.rb +134 -122
  26. data/lib/kramdown/converter/kramdown.rb +24 -25
  27. data/lib/kramdown/converter/latex.rb +65 -55
  28. data/lib/kramdown/document.rb +487 -42
  29. data/lib/kramdown/error.rb +3 -0
  30. data/lib/kramdown/options.rb +83 -28
  31. data/lib/kramdown/parser.rb +5 -5
  32. data/lib/kramdown/parser/base.rb +55 -13
  33. data/lib/kramdown/parser/html.rb +83 -71
  34. data/lib/kramdown/parser/kramdown.rb +73 -54
  35. data/lib/kramdown/parser/kramdown/abbreviation.rb +17 -12
  36. data/lib/kramdown/parser/kramdown/autolink.rb +2 -3
  37. data/lib/kramdown/parser/kramdown/blank_line.rb +1 -1
  38. data/lib/kramdown/parser/kramdown/block_boundary.rb +2 -2
  39. data/lib/kramdown/parser/kramdown/blockquote.rb +2 -2
  40. data/lib/kramdown/parser/kramdown/codeblock.rb +5 -2
  41. data/lib/kramdown/parser/kramdown/codespan.rb +1 -2
  42. data/lib/kramdown/parser/kramdown/emphasis.rb +1 -1
  43. data/lib/kramdown/parser/kramdown/escaped_chars.rb +1 -1
  44. data/lib/kramdown/parser/kramdown/extensions.rb +204 -0
  45. data/lib/kramdown/parser/kramdown/footnote.rb +7 -7
  46. data/lib/kramdown/parser/kramdown/header.rb +4 -2
  47. data/lib/kramdown/parser/kramdown/horizontal_rule.rb +1 -1
  48. data/lib/kramdown/parser/kramdown/html.rb +39 -45
  49. data/lib/kramdown/parser/kramdown/link.rb +19 -29
  50. data/lib/kramdown/parser/kramdown/list.rb +13 -13
  51. data/lib/kramdown/parser/kramdown/math.rb +1 -1
  52. data/lib/kramdown/parser/kramdown/paragraph.rb +5 -4
  53. data/lib/kramdown/parser/kramdown/smart_quotes.rb +1 -1
  54. data/lib/kramdown/parser/kramdown/table.rb +51 -12
  55. data/lib/kramdown/parser/markdown.rb +69 -0
  56. data/lib/kramdown/utils.rb +2 -2
  57. data/lib/kramdown/utils/entities.rb +10 -1
  58. data/lib/kramdown/utils/html.rb +22 -11
  59. data/lib/kramdown/utils/ordered_hash.rb +44 -40
  60. data/lib/kramdown/version.rb +1 -1
  61. data/man/man1/kramdown.1 +31 -4
  62. data/test/testcases/block/08_list/item_ial.html +1 -1
  63. data/test/testcases/block/11_ial/nested.html +11 -0
  64. data/test/testcases/block/11_ial/nested.text +15 -0
  65. data/test/testcases/block/13_definition_list/item_ial.html +1 -1
  66. data/test/testcases/block/14_table/escaping.html +52 -0
  67. data/test/testcases/block/14_table/escaping.text +19 -0
  68. data/test/testcases/block/14_table/simple.html.19 +139 -0
  69. data/test/testcases/block/14_table/simple.text +1 -1
  70. data/test/testcases/block/15_math/normal.html +13 -13
  71. data/test/testcases/block/16_toc/{no_toc_depth.html → no_toc.html} +0 -0
  72. data/test/testcases/block/16_toc/{no_toc_depth.options → no_toc.options} +0 -0
  73. data/test/testcases/block/16_toc/{no_toc_depth.text → no_toc.text} +0 -0
  74. data/test/testcases/block/16_toc/{toc_depth_2.html → toc_levels.html} +4 -4
  75. data/test/testcases/block/16_toc/toc_levels.options +1 -0
  76. data/test/testcases/block/16_toc/{toc_depth_2.text → toc_levels.text} +0 -0
  77. data/test/testcases/span/escaped_chars/normal.html +4 -0
  78. data/test/testcases/span/escaped_chars/normal.text +4 -0
  79. data/test/testcases/span/ial/simple.html +1 -1
  80. data/test/testcases/span/math/normal.html +2 -2
  81. metadata +20 -25
  82. data/benchmark/historic-jruby-1.4.0.dat +0 -7
  83. data/benchmark/historic-ruby-1.8.6.dat +0 -7
  84. data/benchmark/historic-ruby-1.8.7.dat +0 -7
  85. data/benchmark/historic-ruby-1.9.1p243.dat +0 -7
  86. data/benchmark/historic-ruby-1.9.2dev.dat +0 -7
  87. data/benchmark/static-jruby-1.4.0.dat +0 -7
  88. data/benchmark/static-ruby-1.8.6.dat +0 -7
  89. data/benchmark/static-ruby-1.8.7.dat +0 -7
  90. data/benchmark/static-ruby-1.9.1p243.dat +0 -7
  91. data/benchmark/static-ruby-1.9.2dev.dat +0 -7
  92. data/lib/kramdown/parser/kramdown/attribute_list.rb +0 -111
  93. data/lib/kramdown/parser/kramdown/extension.rb +0 -116
  94. data/test/testcases/block/16_toc/toc_depth_2.options +0 -1
@@ -1,7 +1,7 @@
1
1
  <ul>
2
2
  <li class="cls">IAL at first
3
3
  continued</li>
4
- <li>another </li>
4
+ <li>another {:.cls}</li>
5
5
  <li class="cls">IAL at last
6
6
  code</li>
7
7
  </ul>
@@ -0,0 +1,11 @@
1
+ <div class="cls" id="id">
2
+ test
3
+ </div>
4
+
5
+ <div class="cls" id="id">
6
+ <p>test</p>
7
+ </div>
8
+
9
+ <blockquote class="cls" id="id">
10
+ <p>para</p>
11
+ </blockquote>
@@ -0,0 +1,15 @@
1
+ {:.cls}
2
+ <div>
3
+ test
4
+ </div>
5
+ {:#id}
6
+
7
+ {:.cls}
8
+ <div markdown="1">
9
+ test
10
+ </div>
11
+ {:#id}
12
+
13
+ {:.cls}
14
+ > para
15
+ {:#id}
@@ -2,7 +2,7 @@
2
2
  <dt>item</dt>
3
3
  <dd class="cls">definition
4
4
  continued</dd>
5
- <dd>another </dd>
5
+ <dd>another {:.cls}</dd>
6
6
  <dd class="class">
7
7
  <pre><code>code
8
8
  </code></pre>
@@ -0,0 +1,52 @@
1
+ <p><code>cell 1 | cell 2</code></p>
2
+
3
+ <p>cell 1 | cell 2</p>
4
+
5
+ <table>
6
+ <tbody>
7
+ <tr>
8
+ <td>cell 1</td>
9
+ <td>cell 2 | continued</td>
10
+ </tr>
11
+ </tbody>
12
+ </table>
13
+
14
+ <table>
15
+ <tbody>
16
+ <tr>
17
+ <td>cell 1</td>
18
+ <td>cell <code>2</code></td>
19
+ </tr>
20
+ </tbody>
21
+ </table>
22
+
23
+ <table>
24
+ <tbody>
25
+ <tr>
26
+ <td>cell 1</td>
27
+ <td><code>code | span</code></td>
28
+ </tr>
29
+ </tbody>
30
+ </table>
31
+
32
+ <p>cell 1 <code>code | span</code></p>
33
+
34
+ <p>cell 1 | <code>code | span</code></p>
35
+
36
+ <table>
37
+ <tbody>
38
+ <tr>
39
+ <td>cell 1</td>
40
+ <td>cell `2</td>
41
+ <td>cell 3</td>
42
+ </tr>
43
+ <tr>
44
+ <td>cell 1`</td>
45
+ <td>cell 2</td>
46
+ <td>cell 3</td>
47
+ </tr>
48
+ </tbody>
49
+ </table>
50
+
51
+ <p>cell 1 | cell <code>2 | cell 3
52
+ cell 1</code> | cell 2 | cell 3</p>
@@ -0,0 +1,19 @@
1
+ `cell 1 | cell 2`
2
+
3
+ cell 1 \| cell 2
4
+
5
+ cell 1 | cell 2 \| continued
6
+
7
+ cell 1 | cell `2`
8
+
9
+ cell 1 | `code | span`
10
+
11
+ cell 1 `code | span`
12
+
13
+ cell 1 \| `code | span`
14
+
15
+ cell 1 | cell `2 | cell 3
16
+ cell 1` | cell 2 | cell 3
17
+
18
+ cell 1 \| cell `2 | cell 3
19
+ cell 1` | cell 2 | cell 3
@@ -0,0 +1,139 @@
1
+ <table>
2
+ <tbody>
3
+ <tr>
4
+ <td>cell1</td>
5
+ <td>cell2</td>
6
+ </tr>
7
+ <tr>
8
+ <td>cell3</td>
9
+ <td>cell4</td>
10
+ </tr>
11
+ <tr>
12
+ <td>cell5</td>
13
+ <td>cell6 |</td>
14
+ </tr>
15
+ <tr>
16
+ <td>cell7</td>
17
+ <td>cell8</td>
18
+ </tr>
19
+ </tbody>
20
+ </table>
21
+
22
+ <p>Missing cells at end</p>
23
+
24
+ <table>
25
+ <tbody>
26
+ <tr>
27
+ <td>cell1</td>
28
+ <td>cell2</td>
29
+ <td>cell3</td>
30
+ </tr>
31
+ <tr>
32
+ <td>cell1</td>
33
+ <td> </td>
34
+ <td> </td>
35
+ </tr>
36
+ <tr>
37
+ <td> </td>
38
+ <td>cell2</td>
39
+ <td>cell3</td>
40
+ </tr>
41
+ </tbody>
42
+ </table>
43
+
44
+ <p>Escaped pipe characters</p>
45
+
46
+ <table>
47
+ <tbody>
48
+ <tr>
49
+ <td>cell1 | cell1</td>
50
+ <td>cell2</td>
51
+ </tr>
52
+ <tr>
53
+ <td>cell1</td>
54
+ <td>cell2 |</td>
55
+ </tr>
56
+ <tr>
57
+ <td>cell1 <code>|</code> con</td>
58
+ <td>cell2</td>
59
+ </tr>
60
+ </tbody>
61
+ </table>
62
+
63
+ <table class="cls">
64
+ <tbody>
65
+ <tr>
66
+ <td>table</td>
67
+ <td>with</td>
68
+ <td>ial</td>
69
+ </tr>
70
+ </tbody>
71
+ </table>
72
+
73
+ <table class="cls">
74
+ <tbody>
75
+ <tr>
76
+ <td>table</td>
77
+ <td>with</td>
78
+ <td>ial</td>
79
+ </tr>
80
+ </tbody>
81
+ </table>
82
+
83
+ <p>not starting with a bar</p>
84
+
85
+ <table>
86
+ <tbody>
87
+ <tr>
88
+ <td>simple</td>
89
+ <td>table</td>
90
+ </tr>
91
+ </tbody>
92
+ </table>
93
+
94
+ <table>
95
+ <thead>
96
+ <tr>
97
+ <th>head1</th>
98
+ <th>head2</th>
99
+ </tr>
100
+ </thead>
101
+ <tbody>
102
+ <tr>
103
+ <td>cell1</td>
104
+ <td>cell2</td>
105
+ </tr>
106
+ </tbody>
107
+ </table>
108
+
109
+ <table>
110
+ <thead>
111
+ <tr>
112
+ <th>head1</th>
113
+ <th>head2</th>
114
+ </tr>
115
+ </thead>
116
+ <tbody>
117
+ <tr>
118
+ <td> </td>
119
+ <td>cell2</td>
120
+ </tr>
121
+ </tbody>
122
+ </table>
123
+
124
+ <table>
125
+ <tbody>
126
+ <tr>
127
+ <td>a</td>
128
+ <td>b</td>
129
+ </tr>
130
+ <tr>
131
+ <td>c</td>
132
+ <td>d</td>
133
+ </tr>
134
+ <tr>
135
+ <td>e</td>
136
+ <td>f</td>
137
+ </tr>
138
+ </tbody>
139
+ </table>
@@ -13,7 +13,7 @@ Escaped pipe characters
13
13
 
14
14
  | cell1 \| cell1 | cell2 |
15
15
  | cell1 | cell2 \|
16
- | cell1 `\|` con | cell2
16
+ | cell1 `|` con | cell2
17
17
 
18
18
  {:.cls}
19
19
  | table | with | ial
@@ -1,26 +1,26 @@
1
1
  <p>This is a para.
2
- <span class="math"> \text{LaTeX} \lambda_5 </span></p>
2
+ <script type="math/tex"> \text{LaTeX} \lambda_5 </script></p>
3
3
 
4
- <div class="math">\lambda_5 = \alpha + 4</div>
4
+ <script type="math/tex; mode=display">\lambda_5 = \alpha + 4</script>
5
5
 
6
- <p><span class="math">\lambda_\alpha &gt; 5</span>
6
+ <p><script type="math/tex">\lambda_\alpha > 5</script>
7
7
  This is a para.</p>
8
8
 
9
- <div class="math">\begin{align*}
10
- &amp;=5 \\
11
- &amp;=6 \\
12
- \end{align*}</div>
9
+ <script type="math/tex; mode=display">\begin{align*}
10
+ &=5 \\
11
+ &=6 \\
12
+ \end{align*}</script>
13
13
 
14
- <div class="math">5+5</div>
14
+ <script type="math/tex; mode=display">5+5</script>
15
15
 
16
- <div class="math">5+5</div>
16
+ <script type="math/tex; mode=display">5+5</script>
17
17
 
18
- <div class="math">5+5</div>
18
+ <script type="math/tex; mode=display">5+5</script>
19
19
 
20
- <div class="math">5+5</div>
20
+ <script type="math/tex; mode=display">5+5</script>
21
21
 
22
22
  <pre><code>$$5+5$$
23
23
  </code></pre>
24
24
 
25
- <div class="cls math">5+5</div>
26
- <div class="cls math">5+5</div>
25
+ <script type="math/tex; mode=display">5+5</script>
26
+ <script type="math/tex; mode=display">5+5</script>
@@ -1,10 +1,10 @@
1
1
  <ul id="markdown-toc">
2
- <li><a href="#header-level-1">Header level 1</a> <ul>
3
- <li><a href="#header-level-2">Header level 2</a></li>
2
+ <li><a href="#header-level-2">Header level 2</a> <ul>
3
+ <li><a href="#header-level-3">Header level 3</a></li>
4
4
  </ul>
5
5
  </li>
6
- <li><a href="#other-header-level-1">Other header level 1</a> <ul>
7
- <li><a href="#other-header-level-2">Other header level 2</a></li>
6
+ <li><a href="#other-header-level-2">Other header level 2</a> <ul>
7
+ <li><a href="#other-header-level-3">Other header level 3</a></li>
8
8
  </ul>
9
9
  </li>
10
10
  </ul>
@@ -0,0 +1 @@
1
+ :toc_levels: 2..3
@@ -41,3 +41,7 @@
41
41
  <p>'</p>
42
42
 
43
43
  <p>=</p>
44
+
45
+ <p>&gt;</p>
46
+
47
+ <p>&lt;</p>
@@ -2,5 +2,5 @@
2
2
 
3
3
  <p>This is a <code class="hund katz" id="dog" key="val">span</code>.</p>
4
4
 
5
- <p>This is an span ial.
5
+ <p>This is an{: .ignored} span ial.
6
6
  This is an{: .escaped} span ial.</p>
@@ -1,5 +1,5 @@
1
- <p>This is <span class="math">\lambda_\alpha &gt; 5</span> some math.</p>
1
+ <p>This is <script type="math/tex">\lambda_\alpha > 5</script> some math.</p>
2
2
 
3
- <p><span class="math">5+5</span> inline math, $5.00 $$no math$$</p>
3
+ <p><script type="math/tex">5+5</script> inline math, $5.00 $$no math$$</p>
4
4
 
5
5
  <p>$$5+5$$ inline math</p>
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 11
7
+ - 12
8
8
  - 0
9
- version: 0.11.0
9
+ version: 0.12.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - Thomas Leitner
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-10-01 00:00:00 +02:00
17
+ date: 2010-11-01 00:00:00 +01:00
18
18
  default_executable: kramdown
19
19
  dependencies: []
20
20
 
@@ -27,8 +27,8 @@ executables:
27
27
  - kramdown
28
28
  extensions: []
29
29
 
30
- extra_rdoc_files: []
31
-
30
+ extra_rdoc_files:
31
+ - README
32
32
  files:
33
33
  - Rakefile
34
34
  - setup.rb
@@ -41,28 +41,21 @@ files:
41
41
  - CONTRIBUTERS
42
42
  - bin/kramdown
43
43
  - benchmark/timing.sh
44
- - benchmark/historic-ruby-1.9.2dev.dat
45
- - benchmark/historic-jruby-1.4.0.dat
46
- - benchmark/static-jruby-1.4.0.dat
47
44
  - benchmark/generate_data.rb
48
- - benchmark/historic-ruby-1.8.7.dat
49
- - benchmark/historic-ruby-1.8.6.dat
50
- - benchmark/static-ruby-1.9.2dev.dat
51
- - benchmark/static-ruby-1.8.7.dat
52
45
  - benchmark/mdsyntax.text
53
- - benchmark/historic-ruby-1.9.1p243.dat
54
- - benchmark/static-ruby-1.8.6.dat
46
+ - benchmark/benchmark.sh
55
47
  - benchmark/mdbasics.text
56
- - benchmark/static-ruby-1.9.1p243.dat
57
48
  - benchmark/testing.sh
58
49
  - benchmark/benchmark.rb
59
50
  - lib/kramdown.rb
60
51
  - lib/kramdown/utils.rb
61
52
  - lib/kramdown/parser/base.rb
53
+ - lib/kramdown/parser/markdown.rb
62
54
  - lib/kramdown/parser/html.rb
63
55
  - lib/kramdown/parser/kramdown.rb
64
56
  - lib/kramdown/parser/kramdown/abbreviation.rb
65
57
  - lib/kramdown/parser/kramdown/smart_quotes.rb
58
+ - lib/kramdown/parser/kramdown/extensions.rb
66
59
  - lib/kramdown/parser/kramdown/list.rb
67
60
  - lib/kramdown/parser/kramdown/autolink.rb
68
61
  - lib/kramdown/parser/kramdown/html_entity.rb
@@ -76,13 +69,11 @@ files:
76
69
  - lib/kramdown/parser/kramdown/line_break.rb
77
70
  - lib/kramdown/parser/kramdown/link.rb
78
71
  - lib/kramdown/parser/kramdown/horizontal_rule.rb
79
- - lib/kramdown/parser/kramdown/extension.rb
80
72
  - lib/kramdown/parser/kramdown/blockquote.rb
81
73
  - lib/kramdown/parser/kramdown/eob.rb
82
74
  - lib/kramdown/parser/kramdown/codespan.rb
83
75
  - lib/kramdown/parser/kramdown/header.rb
84
76
  - lib/kramdown/parser/kramdown/math.rb
85
- - lib/kramdown/parser/kramdown/attribute_list.rb
86
77
  - lib/kramdown/parser/kramdown/blank_line.rb
87
78
  - lib/kramdown/parser/kramdown/footnote.rb
88
79
  - lib/kramdown/parser/kramdown/codeblock.rb
@@ -227,6 +218,8 @@ files:
227
218
  - test/testcases/block/03_paragraph/no_newline_at_end.html
228
219
  - test/testcases/block/14_table/errors.text
229
220
  - test/testcases/block/14_table/simple.html
221
+ - test/testcases/block/14_table/escaping.text
222
+ - test/testcases/block/14_table/escaping.html
230
223
  - test/testcases/block/14_table/simple.text
231
224
  - test/testcases/block/14_table/header.html
232
225
  - test/testcases/block/14_table/no_table.html
@@ -235,6 +228,7 @@ files:
235
228
  - test/testcases/block/14_table/errors.html
236
229
  - test/testcases/block/14_table/footer.html
237
230
  - test/testcases/block/14_table/no_table.text
231
+ - test/testcases/block/14_table/simple.html.19
238
232
  - test/testcases/block/12_extension/options2.text
239
233
  - test/testcases/block/12_extension/comment.text
240
234
  - test/testcases/block/12_extension/ignored.html
@@ -358,9 +352,11 @@ files:
358
352
  - test/testcases/block/10_ald/simple.html
359
353
  - test/testcases/block/10_ald/simple.text
360
354
  - test/testcases/block/11_ial/simple.html
355
+ - test/testcases/block/11_ial/nested.text
361
356
  - test/testcases/block/11_ial/auto_id_and_ial.html
362
357
  - test/testcases/block/11_ial/simple.text
363
358
  - test/testcases/block/11_ial/auto_id_and_ial.options
359
+ - test/testcases/block/11_ial/nested.html
364
360
  - test/testcases/block/11_ial/auto_id_and_ial.text
365
361
  - test/testcases/block/07_horizontal_rule/septabs.text
366
362
  - test/testcases/block/07_horizontal_rule/septabs.html
@@ -401,12 +397,12 @@ files:
401
397
  - test/testcases/block/05_blockquote/with_code_blocks.text
402
398
  - test/testcases/block/05_blockquote/nested.html
403
399
  - test/testcases/block/05_blockquote/with_code_blocks.html
404
- - test/testcases/block/16_toc/toc_depth_2.html
405
- - test/testcases/block/16_toc/no_toc_depth.options
406
- - test/testcases/block/16_toc/no_toc_depth.html
407
- - test/testcases/block/16_toc/toc_depth_2.options
408
- - test/testcases/block/16_toc/toc_depth_2.text
409
- - test/testcases/block/16_toc/no_toc_depth.text
400
+ - test/testcases/block/16_toc/no_toc.options
401
+ - test/testcases/block/16_toc/no_toc.text
402
+ - test/testcases/block/16_toc/no_toc.html
403
+ - test/testcases/block/16_toc/toc_levels.html
404
+ - test/testcases/block/16_toc/toc_levels.text
405
+ - test/testcases/block/16_toc/toc_levels.options
410
406
  - test/testcases/block/01_blank_line/spaces.html
411
407
  - test/testcases/block/01_blank_line/tabs.text
412
408
  - test/testcases/block/01_blank_line/spaces.text
@@ -439,9 +435,8 @@ licenses: []
439
435
 
440
436
  post_install_message:
441
437
  rdoc_options:
442
- - --line-numbers
443
438
  - --main
444
- - Kramdown
439
+ - README
445
440
  require_paths:
446
441
  - lib
447
442
  required_ruby_version: !ruby/object:Gem::Requirement