kramdown 0.1.0 → 0.2.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 (87) hide show
  1. data/COPYING +1 -1
  2. data/ChangeLog +423 -1
  3. data/Rakefile +5 -5
  4. data/VERSION +1 -1
  5. data/doc/default.template +4 -4
  6. data/doc/index.page +5 -4
  7. data/doc/news.feed +1 -1
  8. data/doc/quickref.page +72 -25
  9. data/doc/syntax.page +238 -66
  10. data/doc/tests.page +2 -3
  11. data/lib/kramdown/converter.rb +41 -10
  12. data/lib/kramdown/deprecated.rb +41 -0
  13. data/lib/kramdown/document.rb +17 -8
  14. data/lib/kramdown/extension.rb +13 -7
  15. data/lib/kramdown/parser.rb +263 -95
  16. data/lib/kramdown/version.rb +28 -0
  17. data/test/run_tests.rb +1 -1
  18. data/test/test_files.rb +1 -1
  19. data/test/testcases/block/02_eob/middle.html +1 -0
  20. data/test/testcases/block/04_header/atx_header.html +8 -0
  21. data/test/testcases/block/04_header/atx_header.text +8 -0
  22. data/test/testcases/block/04_header/setext_header.html +6 -0
  23. data/test/testcases/block/04_header/setext_header.text +9 -0
  24. data/test/testcases/block/07_horizontal_rule/sepspaces.html +3 -0
  25. data/test/testcases/block/07_horizontal_rule/sepspaces.text +3 -0
  26. data/test/testcases/block/07_horizontal_rule/septabs.html +3 -0
  27. data/test/testcases/block/07_horizontal_rule/septabs.text +3 -0
  28. data/test/testcases/block/09_html/content_model/deflists.html +6 -0
  29. data/test/testcases/block/09_html/content_model/deflists.options +1 -0
  30. data/test/testcases/block/09_html/content_model/deflists.text +6 -0
  31. data/test/testcases/block/09_html/content_model/tables.html +14 -0
  32. data/test/testcases/block/09_html/content_model/tables.options +1 -0
  33. data/test/testcases/block/09_html/content_model/tables.text +14 -0
  34. data/test/testcases/block/09_html/html_and_codeblocks.options +1 -1
  35. data/test/testcases/block/09_html/invalid_html_1.html +0 -2
  36. data/test/testcases/block/09_html/invalid_html_2.html +2 -3
  37. data/test/testcases/block/09_html/markdown_attr.html +38 -0
  38. data/test/testcases/block/09_html/markdown_attr.text +38 -0
  39. data/test/testcases/block/09_html/not_parsed.html +14 -0
  40. data/test/testcases/block/09_html/not_parsed.text +15 -0
  41. data/test/testcases/block/09_html/parse_as_raw.html +16 -14
  42. data/test/testcases/block/09_html/parse_as_raw.options +1 -0
  43. data/test/testcases/block/09_html/parse_as_raw.text +13 -1
  44. data/test/testcases/block/09_html/parse_as_span.html +2 -5
  45. data/test/testcases/block/09_html/parse_as_span.options +1 -0
  46. data/test/testcases/block/09_html/{auto_parse_block_html.html → parse_block_html.html} +0 -0
  47. data/test/testcases/block/09_html/parse_block_html.options +1 -0
  48. data/test/testcases/block/09_html/{auto_parse_block_html.text → parse_block_html.text} +0 -0
  49. data/test/testcases/block/09_html/simple.html +21 -30
  50. data/test/testcases/block/09_html/simple.options +1 -0
  51. data/test/testcases/block/09_html/simple.text +13 -2
  52. data/test/testcases/block/11_ial/auto_id_and_ial.html +1 -0
  53. data/test/testcases/block/11_ial/auto_id_and_ial.options +1 -0
  54. data/test/testcases/block/11_ial/auto_id_and_ial.text +2 -0
  55. data/test/testcases/block/12_extension/{nokramdown.html → nomarkdown.html} +0 -0
  56. data/test/testcases/block/12_extension/{nokramdown.text → nomarkdown.text} +4 -4
  57. data/test/testcases/block/12_extension/{kdoptions.html → options.html} +9 -0
  58. data/test/testcases/block/12_extension/options.text +28 -0
  59. data/test/testcases/block/12_extension/{kdoptions2.html → options2.html} +0 -0
  60. data/test/testcases/block/12_extension/{kdoptions2.text → options2.text} +1 -1
  61. data/test/testcases/block/13_definition_list/definition_at_beginning.html +1 -0
  62. data/test/testcases/block/13_definition_list/definition_at_beginning.text +1 -0
  63. data/test/testcases/block/13_definition_list/multiple_terms.html +13 -0
  64. data/test/testcases/block/13_definition_list/multiple_terms.text +10 -0
  65. data/test/testcases/block/13_definition_list/para_wrapping.html +10 -0
  66. data/test/testcases/block/13_definition_list/para_wrapping.text +6 -0
  67. data/test/testcases/block/13_definition_list/separated_by_eob.html +8 -0
  68. data/test/testcases/block/13_definition_list/separated_by_eob.text +5 -0
  69. data/test/testcases/block/13_definition_list/simple.html +8 -0
  70. data/test/testcases/block/13_definition_list/simple.text +7 -0
  71. data/test/testcases/block/13_definition_list/styled_terms.html +4 -0
  72. data/test/testcases/block/13_definition_list/styled_terms.text +2 -0
  73. data/test/testcases/block/13_definition_list/too_much_space.html +3 -0
  74. data/test/testcases/block/13_definition_list/too_much_space.text +4 -0
  75. data/test/testcases/block/13_definition_list/with_blocks.html +38 -0
  76. data/test/testcases/block/13_definition_list/with_blocks.text +24 -0
  77. data/test/testcases/span/05_html/across_lines.html +1 -0
  78. data/test/testcases/span/05_html/across_lines.text +2 -0
  79. data/test/testcases/span/05_html/link_with_mailto.html +1 -0
  80. data/test/testcases/span/05_html/link_with_mailto.text +1 -0
  81. data/test/testcases/span/05_html/markdown_attr.html +5 -0
  82. data/test/testcases/span/05_html/markdown_attr.text +5 -0
  83. data/test/testcases/span/05_html/normal.html +7 -0
  84. data/test/testcases/span/05_html/normal.text +7 -0
  85. metadata +56 -12
  86. data/test/testcases/block/09_html/auto_parse_block_html.options +0 -1
  87. data/test/testcases/block/12_extension/kdoptions.text +0 -18
@@ -0,0 +1 @@
1
+ :parse_block_html: true
@@ -1,4 +1,4 @@
1
- <div>
1
+ <div>
2
2
  test
3
3
  </div>
4
4
 
@@ -37,8 +37,9 @@ para5
37
37
  hallo
38
38
  </div>
39
39
 
40
- <div>hallo<div>test</div>
40
+ <div>hallo<div>test
41
41
  hallo
42
+ </div>
42
43
  </div></p>
43
44
 
44
45
  <div>
@@ -47,6 +48,12 @@ hallo
47
48
  hallo
48
49
  </div>
49
50
 
51
+ para6
52
+
53
+ <div><div class="clear"></div>
54
+ Another para.
55
+ </div>
56
+
50
57
  <webgen:block name="test" />
51
58
 
52
59
  <some:url name:spac='hallo'>doit</some:url>
@@ -54,3 +61,7 @@ hallo
54
61
  <em>Test</em>
55
62
 
56
63
  <p><em>Test</em></p>
64
+
65
+ <p><em>Test
66
+ </em>
67
+ </p>
@@ -0,0 +1 @@
1
+ <h2 id="myid">A header</h2>
@@ -0,0 +1 @@
1
+ :auto_ids: true
@@ -0,0 +1,2 @@
1
+ ## A header
2
+ {:#myid}
@@ -1,11 +1,11 @@
1
1
  This is a simple paragraph.
2
- {::nokramdown:}
2
+ {::nomarkdown:}
3
3
  This *is* not processed
4
- {::nokramdown:}
4
+ {::nomarkdown:}
5
5
  And another paragraph
6
6
 
7
- {::nokramdown:: this='is' .ignore}
7
+ {::nomarkdown:: this='is' .ignore}
8
8
 
9
9
  Paragraph
10
- {::nokramdown:}
10
+ {::nomarkdown:}
11
11
  Another paragraph
@@ -2,6 +2,15 @@
2
2
 
3
3
  <h1 id="with-header-id">with header id</h1>
4
4
 
5
+ <div>
6
+ some <span>*para*</span>
7
+ </div>
8
+
9
+ <div>
10
+ <p>some <span><em>para</em></span></p>
11
+ </div>
12
+
13
+
5
14
  This is some text.
6
15
 
7
16
  <p>Some text<sup id="fnref:ab"><a href="#fn:ab" rel="footnote">10</a></sup>.</p>
@@ -0,0 +1,28 @@
1
+ # No header id
2
+
3
+ {::options:: unusedvar="val"}
4
+ {::options:: auto_ids="true"}
5
+
6
+ # with header id
7
+
8
+ <div>
9
+ some <span>*para*</span>
10
+ </div>
11
+
12
+ {::options:: parse_block_html="true" parse_span_html="true"}
13
+
14
+ <div>
15
+ some <span>*para*</span>
16
+ </div>
17
+
18
+ {::options:: auto_ids="false" filter_html="p em"}
19
+
20
+ <p>
21
+ This is <em>some</em> text.
22
+ </p>
23
+
24
+ {::options:: footnote_nr="10"}
25
+
26
+ Some text[^ab].
27
+
28
+ [^ab]: Some text.
@@ -1,4 +1,4 @@
1
- {::kdoptions:: footnote_nr="da10"}
1
+ {::options:: footnote_nr="da10"}
2
2
 
3
3
  Some text[^ab].
4
4
 
@@ -0,0 +1 @@
1
+ <p>: no definition</p>
@@ -0,0 +1,13 @@
1
+ <dl>
2
+ <dt>kram</dt>
3
+ <dt><em>down</em></dt>
4
+ <dt>now</dt>
5
+ <dd>definition 1</dd>
6
+ <dd>definition 2</dd>
7
+ <dd>
8
+ <p>definition 3</p>
9
+ </dd>
10
+ <dd>
11
+ <p>definition 4</p>
12
+ </dd>
13
+ </dl>
@@ -0,0 +1,10 @@
1
+ kram
2
+ *down*
3
+ now
4
+ : definition 1
5
+ : definition 2
6
+
7
+ : definition 3
8
+
9
+
10
+ : definition 4
@@ -0,0 +1,10 @@
1
+ <dl>
2
+ <dt>term</dt>
3
+ <dd>
4
+ <p>definition</p>
5
+ </dd>
6
+ <dd>definition</dd>
7
+ <dd>
8
+ <p>definition</p>
9
+ </dd>
10
+ </dl>
@@ -0,0 +1,6 @@
1
+ term
2
+
3
+ : definition
4
+ : definition
5
+
6
+ : definition
@@ -0,0 +1,8 @@
1
+ <dl>
2
+ <dt>kram</dt>
3
+ <dd>down</dd>
4
+ </dl>
5
+ <dl>
6
+ <dt>kram</dt>
7
+ <dd>down</dd>
8
+ </dl>
@@ -0,0 +1,5 @@
1
+ kram
2
+ : down
3
+ ^
4
+ kram
5
+ : down
@@ -0,0 +1,8 @@
1
+ <dl>
2
+ <dt>kram</dt>
3
+ <dd>down</dd>
4
+ <dt>kram</dt>
5
+ <dd>down</dd>
6
+ <dt>kram</dt>
7
+ <dd>down</dd>
8
+ </dl>
@@ -0,0 +1,7 @@
1
+ kram
2
+ : down
3
+
4
+ kram
5
+ : down
6
+ kram
7
+ : down
@@ -0,0 +1,4 @@
1
+ <dl>
2
+ <dt><em>kram</em></dt>
3
+ <dd>down</dd>
4
+ </dl>
@@ -0,0 +1,2 @@
1
+ *kram*
2
+ : down
@@ -0,0 +1,3 @@
1
+ <p>para</p>
2
+
3
+ <p>: no definition</p>
@@ -0,0 +1,4 @@
1
+ para
2
+
3
+
4
+ : no definition
@@ -0,0 +1,38 @@
1
+ <dl>
2
+ <dt>kram</dt>
3
+ <dd>this is some
4
+ text</dd>
5
+ <dd>
6
+ <p>this is some
7
+ more text</p>
8
+ </dd>
9
+ <dt>kram</dt>
10
+ <dd>
11
+ <blockquote>
12
+ <p>blockquote</p>
13
+ </blockquote>
14
+ </dd>
15
+ <dt>kram</dt>
16
+ <dd>
17
+ <pre><code>code
18
+ </code></pre>
19
+ </dd>
20
+ <dt>kram</dt>
21
+ <dd>
22
+ <dl>
23
+ <dt>kram</dt>
24
+ <dd>down</dd>
25
+ </dl>
26
+ </dd>
27
+ <dt>kram</dt>
28
+ <dd>
29
+ <h1>header</h1>
30
+ </dd>
31
+ <dt>kram</dt>
32
+ <dd>
33
+ <ul>
34
+ <li>list</li>
35
+ <li>items</li>
36
+ </ul>
37
+ </dd>
38
+ </dl>
@@ -0,0 +1,24 @@
1
+ kram
2
+ : this is some
3
+ text
4
+
5
+ : this is some
6
+ more text
7
+
8
+ kram
9
+ : > blockquote
10
+
11
+ kram
12
+ :
13
+ code
14
+
15
+ kram
16
+ : kram
17
+ : down
18
+
19
+ kram
20
+ : # header
21
+
22
+ kram
23
+ : * list
24
+ * items
@@ -0,0 +1 @@
1
+ <p>Link: <a href="test foo">test</a></p>
@@ -0,0 +1,2 @@
1
+ Link: <a href="test
2
+ foo">test</a>
@@ -0,0 +1 @@
1
+ <p>Link: <a href="mailto:test@example.com">text</a></p>
@@ -0,0 +1 @@
1
+ Link: <a href="mailto:test@example.com">text</a>
@@ -0,0 +1,5 @@
1
+ <p>This is <span><em>text</em></span>
2
+ This is <span>*text*</span>
3
+ This is <span><em>text</em></span>
4
+ This is <span><em>text</em></span>
5
+ This is <span>* nothing <b markdown="1">to fear</b> about</span>.</p>
@@ -0,0 +1,5 @@
1
+ This is <span markdown="1">*text*</span>
2
+ This is <span markdown="0">*text*</span>
3
+ This is <span markdown="span">*text*</span>
4
+ This is <span markdown="block">*text*</span>
5
+ This is <span markdown="0">* nothing <b markdown="1">to fear</b> about</span>.
@@ -10,8 +10,15 @@
10
10
  <p>This is <span>tag
11
11
  now </span>.</p>
12
12
 
13
+ <p>This is <span>tag
14
+ </span> now.</p>
15
+
13
16
  <p>This is <em>something<span test="do_it" /> strange</em>.</p>
14
17
 
18
+ <p>Auto-closing: <br /></p>
19
+
15
20
  <p>An invalid tag: &lt;hr&gt;</p>
16
21
 
17
22
  <p>An invalid &lt;/closing&gt; tag.</p>
23
+
24
+ <p>A <script>*not*</script> tag.</p>
@@ -10,8 +10,15 @@ This is <!-- a
10
10
  This is <span>tag
11
11
  now </span>.
12
12
 
13
+ This is <span>tag
14
+ </span> now.
15
+
13
16
  This is _something<span test="do_it" /> strange_.
14
17
 
18
+ Auto-closing: <br>
19
+
15
20
  An invalid tag: <hr>
16
21
 
17
22
  An invalid </closing> tag.
23
+
24
+ A <script>*not*</script> tag.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Leitner
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-21 00:00:00 +01:00
12
+ date: 2009-12-03 00:00:00 +01:00
13
13
  default_executable: kramdown
14
14
  dependencies: []
15
15
 
@@ -40,11 +40,13 @@ files:
40
40
  - benchmark/testing.sh
41
41
  - benchmark/timing.sh
42
42
  - lib/kramdown/converter.rb
43
+ - lib/kramdown/deprecated.rb
43
44
  - lib/kramdown/document.rb
44
45
  - lib/kramdown/error.rb
45
46
  - lib/kramdown/extension.rb
46
47
  - lib/kramdown/parser/registry.rb
47
48
  - lib/kramdown/parser.rb
49
+ - lib/kramdown/version.rb
48
50
  - lib/kramdown.rb
49
51
  - doc/default.css
50
52
  - doc/default.template
@@ -115,6 +117,10 @@ files:
115
117
  - test/testcases/block/07_horizontal_rule/error.text
116
118
  - test/testcases/block/07_horizontal_rule/normal.html
117
119
  - test/testcases/block/07_horizontal_rule/normal.text
120
+ - test/testcases/block/07_horizontal_rule/sepspaces.html
121
+ - test/testcases/block/07_horizontal_rule/sepspaces.text
122
+ - test/testcases/block/07_horizontal_rule/septabs.html
123
+ - test/testcases/block/07_horizontal_rule/septabs.text
118
124
  - test/testcases/block/08_list/escaping.html
119
125
  - test/testcases/block/08_list/escaping.text
120
126
  - test/testcases/block/08_list/list_and_hr.html
@@ -135,11 +141,14 @@ files:
135
141
  - test/testcases/block/08_list/single_item.text
136
142
  - test/testcases/block/08_list/special_cases.html
137
143
  - test/testcases/block/08_list/special_cases.text
138
- - test/testcases/block/09_html/auto_parse_block_html.html
139
- - test/testcases/block/09_html/auto_parse_block_html.options
140
- - test/testcases/block/09_html/auto_parse_block_html.text
141
144
  - test/testcases/block/09_html/comment.html
142
145
  - test/testcases/block/09_html/comment.text
146
+ - test/testcases/block/09_html/content_model/deflists.html
147
+ - test/testcases/block/09_html/content_model/deflists.options
148
+ - test/testcases/block/09_html/content_model/deflists.text
149
+ - test/testcases/block/09_html/content_model/tables.html
150
+ - test/testcases/block/09_html/content_model/tables.options
151
+ - test/testcases/block/09_html/content_model/tables.text
143
152
  - test/testcases/block/09_html/filtered_html.html
144
153
  - test/testcases/block/09_html/filtered_html.options
145
154
  - test/testcases/block/09_html/filtered_html.text
@@ -150,28 +159,57 @@ files:
150
159
  - test/testcases/block/09_html/invalid_html_1.text
151
160
  - test/testcases/block/09_html/invalid_html_2.html
152
161
  - test/testcases/block/09_html/invalid_html_2.text
162
+ - test/testcases/block/09_html/markdown_attr.html
163
+ - test/testcases/block/09_html/markdown_attr.text
164
+ - test/testcases/block/09_html/not_parsed.html
165
+ - test/testcases/block/09_html/not_parsed.text
153
166
  - test/testcases/block/09_html/parse_as_raw.html
167
+ - test/testcases/block/09_html/parse_as_raw.options
154
168
  - test/testcases/block/09_html/parse_as_raw.text
155
169
  - test/testcases/block/09_html/parse_as_span.html
170
+ - test/testcases/block/09_html/parse_as_span.options
156
171
  - test/testcases/block/09_html/parse_as_span.text
172
+ - test/testcases/block/09_html/parse_block_html.html
173
+ - test/testcases/block/09_html/parse_block_html.options
174
+ - test/testcases/block/09_html/parse_block_html.text
157
175
  - test/testcases/block/09_html/processing_instruction.html
158
176
  - test/testcases/block/09_html/processing_instruction.text
159
177
  - test/testcases/block/09_html/simple.html
178
+ - test/testcases/block/09_html/simple.options
160
179
  - test/testcases/block/09_html/simple.text
161
180
  - test/testcases/block/10_ald/simple.html
162
181
  - test/testcases/block/10_ald/simple.text
182
+ - test/testcases/block/11_ial/auto_id_and_ial.html
183
+ - test/testcases/block/11_ial/auto_id_and_ial.options
184
+ - test/testcases/block/11_ial/auto_id_and_ial.text
163
185
  - test/testcases/block/11_ial/simple.html
164
186
  - test/testcases/block/11_ial/simple.text
165
187
  - test/testcases/block/12_extension/comment.html
166
188
  - test/testcases/block/12_extension/comment.text
167
189
  - test/testcases/block/12_extension/ignored.html
168
190
  - test/testcases/block/12_extension/ignored.text
169
- - test/testcases/block/12_extension/kdoptions.html
170
- - test/testcases/block/12_extension/kdoptions.text
171
- - test/testcases/block/12_extension/kdoptions2.html
172
- - test/testcases/block/12_extension/kdoptions2.text
173
- - test/testcases/block/12_extension/nokramdown.html
174
- - test/testcases/block/12_extension/nokramdown.text
191
+ - test/testcases/block/12_extension/nomarkdown.html
192
+ - test/testcases/block/12_extension/nomarkdown.text
193
+ - test/testcases/block/12_extension/options.html
194
+ - test/testcases/block/12_extension/options.text
195
+ - test/testcases/block/12_extension/options2.html
196
+ - test/testcases/block/12_extension/options2.text
197
+ - test/testcases/block/13_definition_list/definition_at_beginning.html
198
+ - test/testcases/block/13_definition_list/definition_at_beginning.text
199
+ - test/testcases/block/13_definition_list/multiple_terms.html
200
+ - test/testcases/block/13_definition_list/multiple_terms.text
201
+ - test/testcases/block/13_definition_list/para_wrapping.html
202
+ - test/testcases/block/13_definition_list/para_wrapping.text
203
+ - test/testcases/block/13_definition_list/separated_by_eob.html
204
+ - test/testcases/block/13_definition_list/separated_by_eob.text
205
+ - test/testcases/block/13_definition_list/simple.html
206
+ - test/testcases/block/13_definition_list/simple.text
207
+ - test/testcases/block/13_definition_list/styled_terms.html
208
+ - test/testcases/block/13_definition_list/styled_terms.text
209
+ - test/testcases/block/13_definition_list/too_much_space.html
210
+ - test/testcases/block/13_definition_list/too_much_space.text
211
+ - test/testcases/block/13_definition_list/with_blocks.html
212
+ - test/testcases/block/13_definition_list/with_blocks.text
175
213
  - test/testcases/span/01_link/empty.html
176
214
  - test/testcases/span/01_link/empty.text
177
215
  - test/testcases/span/01_link/image_in_a.html
@@ -207,6 +245,12 @@ files:
207
245
  - test/testcases/span/04_footnote/footnote_nr.text
208
246
  - test/testcases/span/04_footnote/markers.html
209
247
  - test/testcases/span/04_footnote/markers.text
248
+ - test/testcases/span/05_html/across_lines.html
249
+ - test/testcases/span/05_html/across_lines.text
250
+ - test/testcases/span/05_html/link_with_mailto.html
251
+ - test/testcases/span/05_html/link_with_mailto.text
252
+ - test/testcases/span/05_html/markdown_attr.html
253
+ - test/testcases/span/05_html/markdown_attr.text
210
254
  - test/testcases/span/05_html/normal.html
211
255
  - test/testcases/span/05_html/normal.text
212
256
  - test/testcases/span/autolinks/url_links.html
@@ -254,6 +298,6 @@ rubyforge_project: kramdown
254
298
  rubygems_version: 1.3.5
255
299
  signing_key:
256
300
  specification_version: 3
257
- summary: kramdown is a fast, pure-Ruby converter for Markdown-like markup.
301
+ summary: kramdown is a fast, pure-Ruby Markdown-superset converter.
258
302
  test_files: []
259
303