kramdown 0.3.0 → 0.4.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 (48) hide show
  1. data/ChangeLog +243 -0
  2. data/Rakefile +0 -17
  3. data/VERSION +1 -1
  4. data/benchmark/historic-jruby-1.4.0.dat +7 -7
  5. data/benchmark/historic-ruby-1.8.6.dat +7 -7
  6. data/benchmark/historic-ruby-1.8.7.dat +7 -7
  7. data/benchmark/historic-ruby-1.9.1p243.dat +7 -7
  8. data/benchmark/historic-ruby-1.9.2dev.dat +7 -7
  9. data/benchmark/testing.sh +1 -1
  10. data/doc/index.page +4 -3
  11. data/doc/quickref.page +31 -1
  12. data/doc/syntax.page +166 -12
  13. data/lib/kramdown/converter.rb +107 -56
  14. data/lib/kramdown/document.rb +16 -1
  15. data/lib/kramdown/extension.rb +19 -0
  16. data/lib/kramdown/parser/kramdown.rb +2 -1
  17. data/lib/kramdown/parser/kramdown/attribute_list.rb +2 -2
  18. data/lib/kramdown/parser/kramdown/codeblock.rb +5 -9
  19. data/lib/kramdown/parser/kramdown/escaped_chars.rb +1 -1
  20. data/lib/kramdown/parser/kramdown/footnote.rb +2 -1
  21. data/lib/kramdown/parser/kramdown/table.rb +125 -0
  22. data/lib/kramdown/version.rb +1 -1
  23. data/test/testcases/block/06_codeblock/with_blank_line.text +1 -0
  24. data/test/testcases/block/09_html/parse_as_span.html +3 -0
  25. data/test/testcases/block/09_html/parse_as_span.text +2 -0
  26. data/test/testcases/block/11_ial/simple.html +3 -0
  27. data/test/testcases/block/11_ial/simple.text +4 -2
  28. data/test/testcases/block/12_extension/options.html +1 -1
  29. data/test/testcases/block/12_extension/options2.html +1 -1
  30. data/test/testcases/block/12_extension/options3.html +7 -0
  31. data/test/testcases/block/12_extension/options3.text +7 -0
  32. data/test/testcases/block/13_definition_list/no_def_list.html +2 -0
  33. data/test/testcases/block/13_definition_list/no_def_list.text +2 -0
  34. data/test/testcases/block/14_table/errors.html +3 -0
  35. data/test/testcases/block/14_table/errors.text +3 -0
  36. data/test/testcases/block/14_table/footer.html +65 -0
  37. data/test/testcases/block/14_table/footer.text +25 -0
  38. data/test/testcases/block/14_table/header.html +103 -0
  39. data/test/testcases/block/14_table/header.text +32 -0
  40. data/test/testcases/block/14_table/no_table.html +3 -0
  41. data/test/testcases/block/14_table/no_table.text +3 -0
  42. data/test/testcases/block/14_table/simple.html +61 -0
  43. data/test/testcases/block/14_table/simple.text +16 -0
  44. data/test/testcases/span/04_footnote/footnote_nr.html +1 -1
  45. data/test/testcases/span/04_footnote/markers.html +1 -1
  46. data/test/testcases/span/escaped_chars/normal.html +4 -0
  47. data/test/testcases/span/escaped_chars/normal.text +4 -0
  48. metadata +17 -2
@@ -23,6 +23,6 @@
23
23
  module Kramdown
24
24
 
25
25
  # The kramdown version.
26
- VERSION = '0.3.0'
26
+ VERSION = '0.4.0'
27
27
 
28
28
  end
@@ -3,6 +3,7 @@ paragraph
3
3
  code block
4
4
 
5
5
  continued here
6
+
6
7
 
7
8
  ended
8
9
 
@@ -3,6 +3,9 @@ should</em> be parsed
3
3
  as span
4
4
  </p>
5
5
 
6
+ <p>This produces `</p>
7
+ <p>` an unwanted result.</p>
8
+
6
9
  <p>This <em>text</em> too</p>
7
10
  <p>
8
11
  some text
@@ -3,5 +3,7 @@ should* be parsed
3
3
  as span
4
4
  </p>
5
5
 
6
+ <p>This produces `</p>` an unwanted result.</p>
7
+
6
8
  <p>This *text* too</p><p>
7
9
  some text
@@ -11,6 +11,9 @@
11
11
  <pre id="other"><code>code block
12
12
  </code></pre>
13
13
 
14
+ <pre><code>other code block
15
+ </code></pre>
16
+
14
17
  <h2 id="myid">A header</h2>
15
18
 
16
19
  <h1 class="class" id="other">Another header</h1>
@@ -3,13 +3,15 @@ Some paragraph.
3
3
 
4
4
  > quote
5
5
  {: #id}
6
- {: .class}
6
+ {: .class}
7
7
 
8
8
  * list
9
9
  {: key="val"}
10
10
 
11
11
  code block
12
- {: #other}
12
+ {: #other}
13
+
14
+ other code block
13
15
 
14
16
  ## A header
15
17
  {:#myid}
@@ -15,7 +15,7 @@ This is some text.
15
15
 
16
16
  <p>Some text<sup id="fnref:ab"><a href="#fn:ab" rel="footnote">10</a></sup>.</p>
17
17
 
18
- <div class="kramdown-footnotes">
18
+ <div class="footnotes">
19
19
  <ol start="10">
20
20
  <li id="fn:ab">
21
21
  <p>Some text.<a href="#fnref:ab" rev="footnote">&#8617;</a></p>
@@ -1,7 +1,7 @@
1
1
 
2
2
  <p>Some text<sup id="fnref:ab"><a href="#fn:ab" rel="footnote">1</a></sup>.</p>
3
3
 
4
- <div class="kramdown-footnotes">
4
+ <div class="footnotes">
5
5
  <ol>
6
6
  <li id="fn:ab">
7
7
  <p>Some text.<a href="#fnref:ab" rev="footnote">&#8617;</a></p>
@@ -0,0 +1,7 @@
1
+ <div><span class="CodeRay">x = <span class="co">Class</span>.new
2
+ </span>
3
+ </div>
4
+
5
+ <div><span class="CodeRay">x = <span class="co">Class</span>.new
6
+ </span>
7
+ </div>
@@ -0,0 +1,7 @@
1
+ x = Class.new
2
+ {: lang="ruby"}
3
+
4
+ {::options:: coderay_wrap="span" coderay_line_numbers="" coderay_css="class" coderay_tab_width="4"}
5
+
6
+ x = Class.new
7
+ {: lang="ruby"}
@@ -0,0 +1,2 @@
1
+ <p>This is a para
2
+ : and not a definition list</p>
@@ -0,0 +1,2 @@
1
+ This is a para
2
+ \: and not a definition list
@@ -0,0 +1,3 @@
1
+ <p>No table body</p>
2
+
3
+ <p>|-|-|-</p>
@@ -0,0 +1,3 @@
1
+ No table body
2
+
3
+ |-|-|-
@@ -0,0 +1,65 @@
1
+ <p>Simple footer</p>
2
+
3
+ <table>
4
+ <tbody>
5
+ <tr>
6
+ <td>cell1</td>
7
+ <td>cell2</td>
8
+ </tr>
9
+ </tbody>
10
+ <tfoot>
11
+ <tr>
12
+ <td>cell3</td>
13
+ <td>cell4</td>
14
+ </tr>
15
+ </tfoot>
16
+ </table>
17
+
18
+ <p>Full footer</p>
19
+
20
+ <table>
21
+ <tbody>
22
+ <tr>
23
+ <td>cell1</td>
24
+ <td>cell2</td>
25
+ </tr>
26
+ </tbody>
27
+ <tfoot>
28
+ <tr>
29
+ <td>cell3</td>
30
+ <td>cell4</td>
31
+ </tr>
32
+ </tfoot>
33
+ </table>
34
+
35
+ <p>Footer with separator lines</p>
36
+
37
+ <table>
38
+ <tbody>
39
+ <tr>
40
+ <td>cell1</td>
41
+ <td>cell2</td>
42
+ </tr>
43
+ </tbody>
44
+ <tfoot>
45
+ <tr>
46
+ <td>cell3</td>
47
+ <td>cell4</td>
48
+ </tr>
49
+ <tr>
50
+ <td>cell5</td>
51
+ <td>cell6</td>
52
+ </tr>
53
+ </tfoot>
54
+ </table>
55
+
56
+ <p>Empty footer</p>
57
+
58
+ <table>
59
+ <tbody>
60
+ <tr>
61
+ <td>cell1</td>
62
+ <td>cell2</td>
63
+ </tr>
64
+ </tbody>
65
+ </table>
@@ -0,0 +1,25 @@
1
+ Simple footer
2
+
3
+ | cell1 | cell2
4
+ |=
5
+ | cell3 | cell4
6
+
7
+ Full footer
8
+
9
+ | cell1 | cell2
10
+ |=======|=======|
11
+ | cell3 | cell4
12
+
13
+ Footer with separator lines
14
+
15
+ | cell1 | cell2
16
+ |=======|=======|
17
+ | cell3 | cell4
18
+ |---
19
+ | cell5 | cell6
20
+ |---
21
+
22
+ Empty footer
23
+
24
+ | cell1 | cell2
25
+ |=
@@ -0,0 +1,103 @@
1
+ <p>Simple header</p>
2
+
3
+ <table>
4
+ <thead>
5
+ <tr>
6
+ <th>cell1</th>
7
+ <th>cell2</th>
8
+ </tr>
9
+ </thead>
10
+ <tbody>
11
+ <tr>
12
+ <td>cell3</td>
13
+ <td>cell4</td>
14
+ </tr>
15
+ </tbody>
16
+ </table>
17
+
18
+ <p>Full header</p>
19
+
20
+ <table>
21
+ <thead>
22
+ <tr>
23
+ <th>cell1</th>
24
+ <th>cell2</th>
25
+ </tr>
26
+ </thead>
27
+ <tbody>
28
+ <tr>
29
+ <td>cell3</td>
30
+ <td>cell4</td>
31
+ </tr>
32
+ </tbody>
33
+ </table>
34
+
35
+ <p>With alignment and superfluous alignment defs</p>
36
+
37
+ <table>
38
+ <col />
39
+ <col align="left" />
40
+ <col align="center" />
41
+ <col align="right" />
42
+ <col />
43
+ <thead>
44
+ <tr>
45
+ <th>default</th>
46
+ <th>left</th>
47
+ <th>center</th>
48
+ <th>right</th>
49
+ <th>default</th>
50
+ </tr>
51
+ </thead>
52
+ <tbody>
53
+ <tr>
54
+ <td>cell1</td>
55
+ <td>cell2</td>
56
+ <td>cell3</td>
57
+ <td>cell4</td>
58
+ <td>cell5</td>
59
+ </tr>
60
+ </tbody>
61
+ </table>
62
+
63
+ <p>With leading sep line</p>
64
+
65
+ <table>
66
+ <thead>
67
+ <tr>
68
+ <th>cell1</th>
69
+ <th>cell2</th>
70
+ </tr>
71
+ </thead>
72
+ <tbody>
73
+ <tr>
74
+ <td>cell3</td>
75
+ <td>cell4</td>
76
+ </tr>
77
+ </tbody>
78
+ </table>
79
+
80
+ <p>Multiple bodies</p>
81
+
82
+ <table>
83
+ <col align="center" />
84
+ <col />
85
+ <thead>
86
+ <tr>
87
+ <th>cell1</th>
88
+ <th>cell2</th>
89
+ </tr>
90
+ </thead>
91
+ <tbody>
92
+ <tr>
93
+ <td>cell3</td>
94
+ <td>cell4</td>
95
+ </tr>
96
+ </tbody>
97
+ <tbody>
98
+ <tr>
99
+ <td>cell5</td>
100
+ <td>cell6</td>
101
+ </tr>
102
+ </tbody>
103
+ </table>
@@ -0,0 +1,32 @@
1
+ Simple header
2
+
3
+ | cell1 | cell2
4
+ |-----
5
+ | cell3 | cell4
6
+
7
+ Full header
8
+
9
+ | cell1 | cell2
10
+ |-------|-------|
11
+ | cell3 | cell4
12
+
13
+ With alignment and superfluous alignment defs
14
+
15
+ | default | left | center | right | default
16
+ |-| :- |:-: | -: | - | :-: | :-
17
+ | cell1 | cell2 | cell3 | cell4 | cell5
18
+
19
+ With leading sep line
20
+
21
+ |:-:|-:|
22
+ | cell1 | cell2
23
+ |-------|-------|
24
+ | cell3 | cell4
25
+
26
+ Multiple bodies
27
+
28
+ | cell1 | cell2
29
+ + :-:
30
+ | cell3 | cell4
31
+ |----|||
32
+ | cell5 | cell6
@@ -0,0 +1,3 @@
1
+ <p>No table</p>
2
+
3
+ <p>| Some | thing | here</p>
@@ -0,0 +1,3 @@
1
+ No table
2
+
3
+ \| Some | thing | here
@@ -0,0 +1,61 @@
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>&nbsp;</td>
34
+ <td>&nbsp;</td>
35
+ </tr>
36
+ <tr>
37
+ <td>&nbsp;</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>
@@ -0,0 +1,16 @@
1
+ | cell1 | cell2 |
2
+ |cell3 | cell4|
3
+ |cell5|cell6 \|
4
+ | cell7|cell8
5
+
6
+ Missing cells at end
7
+
8
+ | cell1 | cell2 | cell3 |
9
+ | cell1 ||
10
+ || cell2 | cell3
11
+
12
+ Escaped pipe characters
13
+
14
+ | cell1 \| cell1 | cell2 |
15
+ | cell1 | cell2 \|
16
+ | cell1 `\|` con | cell2
@@ -1,6 +1,6 @@
1
1
  <p>This is a footnote<sup id="fnref:ab"><a href="#fn:ab" rel="footnote">35</a></sup>. And another<sup id="fnref:bc"><a href="#fn:bc" rel="footnote">36</a></sup>.</p>
2
2
 
3
- <div class="kramdown-footnotes">
3
+ <div class="footnotes">
4
4
  <ol start="35">
5
5
  <li id="fn:ab">
6
6
  <p>Some text.<a href="#fnref:ab" rev="footnote">&#8617;</a></p>