kramdown 0.8.0 → 0.9.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 (69) hide show
  1. data/CONTRIBUTERS +2 -1
  2. data/ChangeLog +454 -0
  3. data/README +1 -1
  4. data/VERSION +1 -1
  5. data/doc/{default.less.css → default.scss.css} +12 -9
  6. data/doc/documentation.page +1 -1
  7. data/doc/index.page +37 -3
  8. data/doc/syntax.page +10 -7
  9. data/lib/kramdown/converter.rb +1 -0
  10. data/lib/kramdown/converter/html.rb +61 -67
  11. data/lib/kramdown/converter/kramdown.rb +398 -0
  12. data/lib/kramdown/converter/latex.rb +274 -276
  13. data/lib/kramdown/document.rb +2 -0
  14. data/lib/kramdown/options.rb +16 -15
  15. data/lib/kramdown/parser/base.rb +0 -1
  16. data/lib/kramdown/parser/html.rb +122 -27
  17. data/lib/kramdown/parser/kramdown.rb +2 -0
  18. data/lib/kramdown/parser/kramdown/attribute_list.rb +2 -0
  19. data/lib/kramdown/parser/kramdown/extension.rb +2 -1
  20. data/lib/kramdown/parser/kramdown/html.rb +2 -2
  21. data/lib/kramdown/parser/kramdown/html_entity.rb +1 -1
  22. data/lib/kramdown/parser/kramdown/link.rb +5 -2
  23. data/lib/kramdown/parser/kramdown/list.rb +13 -9
  24. data/lib/kramdown/parser/kramdown/math.rb +1 -1
  25. data/lib/kramdown/parser/kramdown/typographic_symbol.rb +4 -4
  26. data/lib/kramdown/utils.rb +36 -0
  27. data/lib/kramdown/utils/entities.rb +338 -0
  28. data/lib/kramdown/utils/html.rb +72 -0
  29. data/lib/kramdown/version.rb +1 -1
  30. data/man/man1/kramdown.1 +20 -17
  31. data/test/run_tests.rb +1 -1
  32. data/test/test_files.rb +60 -3
  33. data/test/testcases/block/06_codeblock/whitespace.html +2 -2
  34. data/test/testcases/block/07_horizontal_rule/error.html.19 +7 -0
  35. data/test/testcases/block/09_html/html_to_native/code.html +1 -1
  36. data/test/testcases/block/09_html/html_to_native/code.text +1 -1
  37. data/test/testcases/block/09_html/html_to_native/table_simple.html +38 -2
  38. data/test/testcases/block/09_html/html_to_native/table_simple.text +42 -0
  39. data/test/testcases/block/09_html/html_to_native/typography.html.19 +1 -0
  40. data/test/testcases/block/09_html/simple.html.19 +62 -0
  41. data/test/testcases/block/11_ial/simple.html +3 -2
  42. data/test/testcases/block/12_extension/comment.html +3 -2
  43. data/test/testcases/block/12_extension/options.html +0 -3
  44. data/test/testcases/block/12_extension/options.text +0 -6
  45. data/test/testcases/block/13_definition_list/item_ial.html +14 -0
  46. data/test/testcases/block/13_definition_list/item_ial.text +8 -0
  47. data/test/testcases/block/16_toc/no_toc_depth.html +33 -0
  48. data/test/testcases/block/16_toc/no_toc_depth.options +1 -0
  49. data/test/testcases/block/16_toc/no_toc_depth.text +16 -0
  50. data/test/testcases/block/16_toc/toc_depth_2.html +24 -0
  51. data/test/testcases/block/16_toc/toc_depth_2.options +1 -0
  52. data/test/testcases/block/16_toc/toc_depth_2.text +16 -0
  53. data/test/testcases/span/01_link/empty.html +2 -0
  54. data/test/testcases/span/01_link/empty.text +2 -0
  55. data/test/testcases/span/01_link/imagelinks.html +2 -0
  56. data/test/testcases/span/01_link/imagelinks.text +2 -0
  57. data/test/testcases/span/01_link/inline.html.19 +40 -0
  58. data/test/testcases/span/01_link/reference.html.19 +32 -0
  59. data/test/testcases/span/extension/comment.html +3 -3
  60. data/test/testcases/span/text_substitutions/entities.html.19 +4 -0
  61. data/test/testcases/span/text_substitutions/entities_numeric.html +1 -0
  62. data/test/testcases/span/text_substitutions/entities_numeric.html.19 +1 -0
  63. data/test/testcases/span/text_substitutions/entities_numeric.options +1 -0
  64. data/test/testcases/span/text_substitutions/entities_numeric.text +1 -0
  65. data/test/testcases/span/text_substitutions/typography.html.19 +18 -0
  66. metadata +30 -10
  67. data/test/testcases/block/09_html/filtered_html.html +0 -1
  68. data/test/testcases/block/09_html/filtered_html.options +0 -1
  69. data/test/testcases/block/09_html/filtered_html.text +0 -1
@@ -0,0 +1 @@
1
+ :auto_ids: true
@@ -0,0 +1,16 @@
1
+ * Here comes the table of content
2
+ {:toc}
3
+
4
+ # Header level 1
5
+
6
+ ## Header level 2
7
+
8
+ ### Header level 3
9
+
10
+ #### Header level 4
11
+
12
+ # Other header level 1
13
+
14
+ ## Other header level 2
15
+
16
+ ### Other header level 3
@@ -0,0 +1,24 @@
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>
4
+ </ul>
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>
8
+ </ul>
9
+ </li>
10
+ </ul>
11
+
12
+ <h1 id="header-level-1">Header level 1</h1>
13
+
14
+ <h2 id="header-level-2">Header level 2</h2>
15
+
16
+ <h3 id="header-level-3">Header level 3</h3>
17
+
18
+ <h4 id="header-level-4">Header level 4</h4>
19
+
20
+ <h1 id="other-header-level-1">Other header level 1</h1>
21
+
22
+ <h2 id="other-header-level-2">Other header level 2</h2>
23
+
24
+ <h3 id="other-header-level-3">Other header level 3</h3>
@@ -0,0 +1 @@
1
+ :toc_depth: 2
@@ -0,0 +1,16 @@
1
+ * Here comes the table of content
2
+ {:toc}
3
+
4
+ # Header level 1
5
+
6
+ ## Header level 2
7
+
8
+ ### Header level 3
9
+
10
+ #### Header level 4
11
+
12
+ # Other header level 1
13
+
14
+ ## Other header level 2
15
+
16
+ ### Other header level 3
@@ -1,3 +1,5 @@
1
1
  <p>This is [] empty.</p>
2
2
 
3
3
  <p>This is [][] empty.</p>
4
+
5
+ <p>This is [](test.html) empty.</p>
@@ -1,3 +1,5 @@
1
1
  This is [] empty.
2
2
 
3
3
  This is [][] empty.
4
+
5
+ This is [](test.html) empty.
@@ -8,5 +8,7 @@
8
8
 
9
9
  <p>Reference style with title: <img alt="alt text" src="other.png" title="Title" /></p>
10
10
 
11
+ <p>No alt text: <img alt="" src="other.png" /></p>
12
+
11
13
  <p>No id: <img alt="imgo" src="other.png" title="Title" /></p>
12
14
 
@@ -8,6 +8,8 @@ Reference style: ![alt text][img]
8
8
 
9
9
  Reference style with title: ![alt text][imgo]
10
10
 
11
+ No alt text: ![](other.png)
12
+
11
13
  No id: ![imgo]
12
14
 
13
15
  [img]: other.png
@@ -0,0 +1,40 @@
1
+ <p>simple <a href="">URL</a></p>
2
+
3
+ <p>simple <a href="something.html">URL</a></p>
4
+
5
+ <p>simple <a href="something.html">URL <em>with</em> formatting</a></p>
6
+
7
+ <p>simple <a href="something.html" title="a t&quot;itle">URL with single quoted title</a></p>
8
+
9
+ <p>simple <a href="something.html" title="a t'itle">URL with double quoted title</a></p>
10
+
11
+ <p>simple <a href="something.html">URL [with ] escaped</a></p>
12
+
13
+ <p>simple <a href="something.html">URL with ] escaped</a></p>
14
+
15
+ <p>simple <a href="something.html">URL [with] nested</a></p>
16
+
17
+ <p>simple <a href="something.html">URL with [no](link.html) inside</a></p>
18
+
19
+ <p>simple <a href="/something/to(do)">URL with parens</a></p>
20
+
21
+ <p>simple <a href="/something/to(do" title="doit">URL with parens</a></p>
22
+
23
+ <p>simple <a href="something.html" title="title">URL broken
24
+ on line</a></p>
25
+
26
+ <p>bad [URL <a href="something.html">not</a></p>
27
+
28
+ <p>bad [URL with parens](something(new.html)</p>
29
+
30
+ <p>bad [URL with leading spaces]( something.html)</p>
31
+
32
+ <p>bad [URL with trailing spaces](something.html )</p>
33
+
34
+ <p>bad [URL with spaces](this is some url.html)</p>
35
+
36
+ <p>bad [URL with empty title](something.html ‘’)</p>
37
+
38
+ <p>bad [URL](</p>
39
+
40
+ <p>bad [URL](no</p>
@@ -0,0 +1,32 @@
1
+
2
+ <p>simple <a href="otherurl.html">URL</a> and <a href="someurl.html">URL</a></p>
3
+
4
+ <p>simple <a href="otherurl.html">URL</a> and <a href="someurl.html">URL</a></p>
5
+
6
+ <p>simple <a href="otherurl.html">1</a> and <a href="someurl.html">isurl</a></p>
7
+
8
+ <p>simple <a href="otherurl.html">1</a> and <a href="someurl.html">isurl</a></p>
9
+
10
+ <p>this is [a holy <a href="someurl.html">isurl</a>]</p>
11
+
12
+ <p>no [resolution][] here and [here]</p>
13
+
14
+ <p>with a <a href="url.html">break in
15
+ the text</a></p>
16
+
17
+ <p>this not [isurl] and not [isurl]</p>
18
+
19
+ <p>a <a href="letters.html" title="This is the title">Link with_BIG</a> letters</p>
20
+
21
+ <p>bad [no URL] d <a href="someurl.html">isurl</a></p>
22
+
23
+ <p>[no % url]: invalid.html
24
+ [no url] invalid.html
25
+ [no url]:</p>
26
+
27
+ <p>“title”</p>
28
+
29
+ <p>test <a href="invalid.html">url but no title</a>
30
+ test [urldef]</p>
31
+
32
+ <p>[urldef]: some.url ‘title”</p>
@@ -1,6 +1,6 @@
1
- <p>This is a paragraph.
2
- This is a paragraph.
3
- This is a .
1
+ <p>This is a <!-- simple --> paragraph.
2
+ This is a <!-- simple --> paragraph.
3
+ This is a <!-- simple {:/other} paragraph -->.
4
4
  This is a paragraph.
5
5
  This is a simple paragraph.
6
6
  This is a paragraph.</p>
@@ -0,0 +1,4 @@
1
+ <p>This is the A&amp;O. © 2008 by me
2
+ As well \&amp; as this. Some ŗ other
3
+ values may ¯ may also show but
4
+ not st. like &amp;#xYZ;.</p>
@@ -0,0 +1 @@
1
+ <p>This is the A&amp;O. &#169; 2008 by me &#343;</p>
@@ -0,0 +1 @@
1
+ <p>This is the A&amp;O. © 2008 by me ŗ</p>
@@ -0,0 +1 @@
1
+ :numeric_entities: true
@@ -0,0 +1 @@
1
+ This is the A&O. &copy; 2008 by me &#343;
@@ -0,0 +1,18 @@
1
+ <p>This is… something—this too–!</p>
2
+
3
+ <p>This «is» some text, « this » too!</p>
4
+
5
+ <p>“Fancy quotes” are ‘cool’, even in the ’80s!
6
+ Je t’ aime. You’re a funny one! Thomas’ name
7
+ Mark’s name. “…you”
8
+ “‘Nested’ quotes are ‘possible’”, too!
9
+ ‘“Otherway” is “round”’!</p>
10
+
11
+ <p>‘Opening now!’</p>
12
+
13
+ <p>’80s are really cool.</p>
14
+
15
+ <p><i>Cluster</i>’s Last Stand.</p>
16
+
17
+ <p>Nam liber tempor
18
+ “…At vero eos et accusam”</p>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown
3
3
  version: !ruby/object:Gem::Version
4
- hash: -1600059249532544559
4
+ hash: -4204154198824919856
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 8
8
+ - 9
9
9
  - 0
10
- version: 0.8.0
10
+ version: 0.9.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Thomas Leitner
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-06-08 00:00:00 +02:00
18
+ date: 2010-06-23 00:00:00 +02:00
19
19
  default_executable: kramdown
20
20
  dependencies: []
21
21
 
@@ -58,6 +58,7 @@ files:
58
58
  - benchmark/testing.sh
59
59
  - benchmark/benchmark.rb
60
60
  - lib/kramdown.rb
61
+ - lib/kramdown/utils.rb
61
62
  - lib/kramdown/parser/base.rb
62
63
  - lib/kramdown/parser/html.rb
63
64
  - lib/kramdown/parser/kramdown.rb
@@ -85,11 +86,14 @@ files:
85
86
  - lib/kramdown/parser/kramdown/blank_line.rb
86
87
  - lib/kramdown/parser/kramdown/footnote.rb
87
88
  - lib/kramdown/parser/kramdown/codeblock.rb
89
+ - lib/kramdown/utils/html.rb
90
+ - lib/kramdown/utils/entities.rb
88
91
  - lib/kramdown/version.rb
89
92
  - lib/kramdown/error.rb
90
93
  - lib/kramdown/converter/base.rb
91
94
  - lib/kramdown/converter/latex.rb
92
95
  - lib/kramdown/converter/html.rb
96
+ - lib/kramdown/converter/kramdown.rb
93
97
  - lib/kramdown/converter.rb
94
98
  - lib/kramdown/parser.rb
95
99
  - lib/kramdown/compatibility.rb
@@ -105,10 +109,10 @@ files:
105
109
  - doc/links.markdown
106
110
  - doc/tests.page
107
111
  - doc/index.page
108
- - doc/default.less.css
109
112
  - doc/default.template
110
113
  - doc/syntax.page
111
114
  - doc/installation.page
115
+ - doc/default.scss.css
112
116
  - doc/virtual
113
117
  - test/run_tests.rb
114
118
  - test/testcases/encoding.text
@@ -148,10 +152,12 @@ files:
148
152
  - test/testcases/span/01_link/inline.html
149
153
  - test/testcases/span/01_link/links_with_angle_brackets.text
150
154
  - test/testcases/span/01_link/reference.text
155
+ - test/testcases/span/01_link/reference.html.19
151
156
  - test/testcases/span/01_link/inline.text
152
157
  - test/testcases/span/01_link/reference.html
153
158
  - test/testcases/span/01_link/empty.html
154
159
  - test/testcases/span/01_link/link_defs.text
160
+ - test/testcases/span/01_link/inline.html.19
155
161
  - test/testcases/span/01_link/empty.text
156
162
  - test/testcases/span/01_link/links_with_angle_brackets.html
157
163
  - test/testcases/span/01_link/imagelinks.html
@@ -172,13 +178,19 @@ files:
172
178
  - test/testcases/span/ial/simple.text
173
179
  - test/testcases/span/math/normal.html
174
180
  - test/testcases/span/math/normal.text
181
+ - test/testcases/span/text_substitutions/entities.html.19
175
182
  - test/testcases/span/text_substitutions/typography.html
176
183
  - test/testcases/span/text_substitutions/entities.html
177
184
  - test/testcases/span/text_substitutions/greaterthan.html
178
185
  - test/testcases/span/text_substitutions/lowerthan.text
186
+ - test/testcases/span/text_substitutions/entities_numeric.options
179
187
  - test/testcases/span/text_substitutions/lowerthan.html
188
+ - test/testcases/span/text_substitutions/entities_numeric.text
180
189
  - test/testcases/span/text_substitutions/typography.text
181
190
  - test/testcases/span/text_substitutions/entities.text
191
+ - test/testcases/span/text_substitutions/entities_numeric.html
192
+ - test/testcases/span/text_substitutions/typography.html.19
193
+ - test/testcases/span/text_substitutions/entities_numeric.html.19
182
194
  - test/testcases/span/text_substitutions/greaterthan.text
183
195
  - test/testcases/span/02_emphasis/errors.text
184
196
  - test/testcases/span/02_emphasis/normal.html
@@ -253,22 +265,20 @@ files:
253
265
  - test/testcases/block/09_html/html_to_native/entity.text
254
266
  - test/testcases/block/09_html/html_to_native/comment.html
255
267
  - test/testcases/block/09_html/html_to_native/table_simple.html
268
+ - test/testcases/block/09_html/html_to_native/typography.html.19
256
269
  - test/testcases/block/09_html/html_to_native/header.options
257
270
  - test/testcases/block/09_html/html_to_native/list_ul.text
258
271
  - test/testcases/block/09_html/html_to_native/list_ol.html
259
272
  - test/testcases/block/09_html/html_to_native/table_normal.html
260
- - test/testcases/block/09_html/filtered_html.text
261
273
  - test/testcases/block/09_html/invalid_html_2.text
262
274
  - test/testcases/block/09_html/markdown_attr.html
263
275
  - test/testcases/block/09_html/simple.text
264
- - test/testcases/block/09_html/filtered_html.options
265
276
  - test/testcases/block/09_html/parse_as_span.options
266
277
  - test/testcases/block/09_html/parse_block_html.html
267
278
  - test/testcases/block/09_html/parse_block_html.text
268
279
  - test/testcases/block/09_html/markdown_attr.text
269
280
  - test/testcases/block/09_html/processing_instruction.text
270
281
  - test/testcases/block/09_html/simple.options
271
- - test/testcases/block/09_html/filtered_html.html
272
282
  - test/testcases/block/09_html/processing_instruction.html
273
283
  - test/testcases/block/09_html/comment.html
274
284
  - test/testcases/block/09_html/parse_as_raw.options
@@ -284,6 +294,7 @@ files:
284
294
  - test/testcases/block/09_html/content_model/deflists.options
285
295
  - test/testcases/block/09_html/content_model/deflists.text
286
296
  - test/testcases/block/09_html/not_parsed.text
297
+ - test/testcases/block/09_html/simple.html.19
287
298
  - test/testcases/block/08_list/special_cases.html
288
299
  - test/testcases/block/08_list/mixed.html
289
300
  - test/testcases/block/08_list/other_first_element.html
@@ -336,6 +347,7 @@ files:
336
347
  - test/testcases/block/07_horizontal_rule/septabs.text
337
348
  - test/testcases/block/07_horizontal_rule/septabs.html
338
349
  - test/testcases/block/07_horizontal_rule/normal.html
350
+ - test/testcases/block/07_horizontal_rule/error.html.19
339
351
  - test/testcases/block/07_horizontal_rule/sepspaces.text
340
352
  - test/testcases/block/07_horizontal_rule/error.html
341
353
  - test/testcases/block/07_horizontal_rule/error.text
@@ -345,8 +357,10 @@ files:
345
357
  - test/testcases/block/13_definition_list/definition_at_beginning.text
346
358
  - test/testcases/block/13_definition_list/simple.html
347
359
  - test/testcases/block/13_definition_list/too_much_space.text
360
+ - test/testcases/block/13_definition_list/item_ial.text
348
361
  - test/testcases/block/13_definition_list/multiple_terms.text
349
362
  - test/testcases/block/13_definition_list/simple.text
363
+ - test/testcases/block/13_definition_list/item_ial.html
350
364
  - test/testcases/block/13_definition_list/no_def_list.text
351
365
  - test/testcases/block/13_definition_list/separated_by_eob.text
352
366
  - test/testcases/block/13_definition_list/with_blocks.html
@@ -369,6 +383,12 @@ files:
369
383
  - test/testcases/block/05_blockquote/with_code_blocks.text
370
384
  - test/testcases/block/05_blockquote/nested.html
371
385
  - test/testcases/block/05_blockquote/with_code_blocks.html
386
+ - test/testcases/block/16_toc/toc_depth_2.html
387
+ - test/testcases/block/16_toc/no_toc_depth.options
388
+ - test/testcases/block/16_toc/no_toc_depth.html
389
+ - test/testcases/block/16_toc/toc_depth_2.options
390
+ - test/testcases/block/16_toc/toc_depth_2.text
391
+ - test/testcases/block/16_toc/no_toc_depth.text
372
392
  - test/testcases/block/01_blank_line/spaces.html
373
393
  - test/testcases/block/01_blank_line/tabs.text
374
394
  - test/testcases/block/01_blank_line/spaces.text
@@ -405,7 +425,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
405
425
  requirements:
406
426
  - - ">="
407
427
  - !ruby/object:Gem::Version
408
- hash: -780558437635548252
428
+ hash: -947233339962908927
409
429
  segments:
410
430
  - 0
411
431
  version: "0"
@@ -414,7 +434,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
414
434
  requirements:
415
435
  - - ">="
416
436
  - !ruby/object:Gem::Version
417
- hash: -780558437635548252
437
+ hash: -947233339962908927
418
438
  segments:
419
439
  - 0
420
440
  version: "0"
@@ -1 +0,0 @@
1
- filtered.
@@ -1 +0,0 @@
1
- :filter_html: [p]
@@ -1 +0,0 @@
1
- <p>filtered.</p>