kramdown 0.7.0 → 0.8.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 (93) hide show
  1. data/CONTRIBUTERS +4 -0
  2. data/ChangeLog +671 -0
  3. data/README +10 -0
  4. data/Rakefile +40 -23
  5. data/VERSION +1 -1
  6. data/data/kramdown/document.html +1 -1
  7. data/data/kramdown/document.latex +10 -5
  8. data/doc/default.less.css +52 -10
  9. data/doc/default.template +4 -0
  10. data/doc/documentation.page +72 -0
  11. data/doc/index.page +8 -41
  12. data/doc/installation.page +6 -6
  13. data/doc/links.markdown +2 -0
  14. data/doc/quickref.page +6 -2
  15. data/doc/syntax.page +8 -7
  16. data/doc/tests.page +1 -2
  17. data/lib/kramdown.rb +1 -1
  18. data/lib/kramdown/compatibility.rb +1 -1
  19. data/lib/kramdown/converter.rb +8 -3
  20. data/lib/kramdown/converter/base.rb +27 -5
  21. data/lib/kramdown/converter/html.rb +26 -28
  22. data/lib/kramdown/converter/latex.rb +29 -15
  23. data/lib/kramdown/document.rb +15 -8
  24. data/lib/kramdown/error.rb +1 -1
  25. data/lib/kramdown/options.rb +21 -13
  26. data/lib/kramdown/parser.rb +9 -3
  27. data/lib/kramdown/parser/base.rb +95 -0
  28. data/lib/kramdown/parser/html.rb +387 -0
  29. data/lib/kramdown/parser/kramdown.rb +11 -56
  30. data/lib/kramdown/parser/kramdown/attribute_list.rb +1 -1
  31. data/lib/kramdown/parser/kramdown/autolink.rb +1 -1
  32. data/lib/kramdown/parser/kramdown/blank_line.rb +1 -1
  33. data/lib/kramdown/parser/kramdown/blockquote.rb +1 -1
  34. data/lib/kramdown/parser/kramdown/codeblock.rb +1 -1
  35. data/lib/kramdown/parser/kramdown/codespan.rb +1 -1
  36. data/lib/kramdown/parser/kramdown/emphasis.rb +1 -1
  37. data/lib/kramdown/parser/kramdown/eob.rb +1 -1
  38. data/lib/kramdown/parser/kramdown/escaped_chars.rb +1 -1
  39. data/lib/kramdown/parser/kramdown/extension.rb +2 -90
  40. data/lib/kramdown/parser/kramdown/footnote.rb +1 -1
  41. data/lib/kramdown/parser/kramdown/header.rb +1 -1
  42. data/lib/kramdown/parser/kramdown/horizontal_rule.rb +1 -1
  43. data/lib/kramdown/parser/kramdown/html.rb +69 -149
  44. data/lib/kramdown/parser/kramdown/html_entity.rb +4 -4
  45. data/lib/kramdown/parser/kramdown/line_break.rb +1 -1
  46. data/lib/kramdown/parser/kramdown/link.rb +2 -2
  47. data/lib/kramdown/parser/kramdown/list.rb +2 -6
  48. data/lib/kramdown/parser/kramdown/math.rb +3 -3
  49. data/lib/kramdown/parser/kramdown/paragraph.rb +1 -1
  50. data/lib/kramdown/parser/kramdown/smart_quotes.rb +3 -2
  51. data/lib/kramdown/parser/kramdown/table.rb +3 -2
  52. data/lib/kramdown/parser/kramdown/typographic_symbol.rb +7 -3
  53. data/lib/kramdown/version.rb +2 -2
  54. data/man/man1/kramdown.1 +19 -0
  55. data/test/run_tests.rb +1 -0
  56. data/test/test_files.rb +68 -7
  57. data/test/testcases/block/09_html/comment.html +5 -0
  58. data/test/testcases/block/09_html/comment.text +3 -0
  59. data/test/testcases/block/09_html/content_model/tables.html +2 -2
  60. data/test/testcases/block/09_html/html_to_native/code.html +10 -0
  61. data/test/testcases/block/09_html/html_to_native/code.text +9 -0
  62. data/test/testcases/block/09_html/html_to_native/comment.html +7 -0
  63. data/test/testcases/block/09_html/html_to_native/comment.text +8 -0
  64. data/test/testcases/block/09_html/html_to_native/emphasis.html +1 -0
  65. data/test/testcases/block/09_html/html_to_native/emphasis.text +1 -0
  66. data/test/testcases/block/09_html/html_to_native/entity.html +1 -0
  67. data/test/testcases/block/09_html/html_to_native/entity.text +1 -0
  68. data/test/testcases/block/09_html/html_to_native/header.html +6 -0
  69. data/test/testcases/block/09_html/html_to_native/header.options +2 -0
  70. data/test/testcases/block/09_html/html_to_native/header.text +6 -0
  71. data/test/testcases/block/09_html/html_to_native/list_dl.html +8 -0
  72. data/test/testcases/block/09_html/html_to_native/list_dl.text +8 -0
  73. data/test/testcases/block/09_html/html_to_native/list_ol.html +15 -0
  74. data/test/testcases/block/09_html/html_to_native/list_ol.text +17 -0
  75. data/test/testcases/block/09_html/html_to_native/list_ul.html +19 -0
  76. data/test/testcases/block/09_html/html_to_native/list_ul.text +22 -0
  77. data/test/testcases/block/09_html/html_to_native/options +1 -0
  78. data/test/testcases/block/09_html/html_to_native/paragraph.html +3 -0
  79. data/test/testcases/block/09_html/html_to_native/paragraph.text +4 -0
  80. data/test/testcases/block/09_html/html_to_native/table_normal.html +13 -0
  81. data/test/testcases/block/09_html/html_to_native/table_normal.text +12 -0
  82. data/test/testcases/block/09_html/html_to_native/table_simple.html +10 -0
  83. data/test/testcases/block/09_html/html_to_native/table_simple.text +14 -0
  84. data/test/testcases/block/09_html/html_to_native/typography.html +1 -0
  85. data/test/testcases/block/09_html/html_to_native/typography.text +1 -0
  86. data/test/testcases/block/09_html/parse_as_raw.html +3 -5
  87. data/test/testcases/block/09_html/parse_as_raw.text +0 -1
  88. data/test/testcases/span/04_footnote/definitions.latex +18 -0
  89. data/test/testcases/span/04_footnote/footnote_nr.latex +6 -0
  90. data/test/testcases/span/04_footnote/markers.latex +32 -0
  91. data/test/testcases/span/05_html/invalid.html +1 -0
  92. data/test/testcases/span/05_html/invalid.text +1 -0
  93. metadata +52 -5
@@ -0,0 +1,6 @@
1
+ <h1>Some <em class='cls'>header</em>here!</h1>
2
+ <h2 id="test">hallo</h2>
3
+ <h3>hallo</h3>
4
+ <h4>hallo</h4>
5
+ <h5>hallo</h5>
6
+ <h6>hallo</h6>
@@ -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,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,15 @@
1
+ <ol>
2
+ <li>This is a simple list item</li>
3
+ <li>
4
+ <p>Followed by another</p>
5
+ </li>
6
+ <li>
7
+ <p>Followed by</p>
8
+ <p>a para list item</p>
9
+ </li>
10
+ <li>and a normal one</li>
11
+ <li>
12
+ <p>and</p>
13
+ <p>a para</p>
14
+ </li>
15
+ </ol>
@@ -0,0 +1,17 @@
1
+ <ol>
2
+ <li>This is a simple list item</li>
3
+ <li>
4
+ <p>Followed by another</p>
5
+ </li>
6
+ <li>
7
+ <p>Followed by</p>
8
+
9
+ <p>a para list item</p>
10
+ </li>
11
+ <li>and a normal one</li>
12
+ <li>
13
+ <p>and</p>
14
+
15
+ <p>a para</p>
16
+ </li>
17
+ </ol>
@@ -0,0 +1,19 @@
1
+ <ul>
2
+ <li>This is a simple list item</li>
3
+ <li>
4
+ <p>Followed by another</p>
5
+ </li>
6
+ <li>
7
+ <p>Followed by</p>
8
+ <p>a para list item</p>
9
+ </li>
10
+ <li>and a normal one</li>
11
+ <li>
12
+ <p>and</p>
13
+ <p>a para</p>
14
+ </li>
15
+ </ul>
16
+
17
+ <ul>
18
+ <li>multi line list item</li>
19
+ </ul>
@@ -0,0 +1,22 @@
1
+ <ul>
2
+ <li>This is a simple list item</li>
3
+ <li>
4
+ <p>Followed by another</p>
5
+ </li>
6
+ <li>
7
+ <p>Followed by</p>
8
+
9
+ <p>a para list item</p>
10
+ </li>
11
+ <li>and a normal one</li>
12
+ <li>
13
+ <p>and</p>
14
+
15
+ <p>a para</p>
16
+ </li>
17
+ </ul>
18
+
19
+ <ul>
20
+ <li>multi line
21
+ list item</li>
22
+ </ul>
@@ -0,0 +1 @@
1
+ :html_to_native: true
@@ -0,0 +1,3 @@
1
+ <p>Some text here<span> and </span>end</p>
2
+
3
+ <p>Some other text here</p>
@@ -0,0 +1,4 @@
1
+ <p>Some text here<span> and </span>end
2
+ </p>
3
+
4
+ <p>Some other text here</p>
@@ -0,0 +1,13 @@
1
+ <table class="examples">
2
+ <tr>
3
+ <th>Usage</th>
4
+ <th>Other</th>
5
+ </tr>
6
+ <tr>
7
+ <td>
8
+ Some *data* </td>
9
+ <td>
10
+ <p>Some more</p>
11
+ </td>
12
+ </tr>
13
+ </table>
@@ -0,0 +1,12 @@
1
+ <table class="examples">
2
+ <tr>
3
+ <th>Usage</th>
4
+ <th>Other</th>
5
+ </tr>
6
+ <tr>
7
+ <td>Some *data*</td>
8
+ <td>
9
+ <p>Some more</p>
10
+ </td>
11
+ </tr>
12
+ </table>
@@ -0,0 +1,10 @@
1
+ <table class="examples">
2
+ <tr>
3
+ <th>Usage</th>
4
+ <th>Output</th>
5
+ </tr>
6
+ <tr>
7
+ <td>Some *data*</td>
8
+ <td>Some more</td>
9
+ </tr>
10
+ </table>
@@ -0,0 +1,14 @@
1
+ <table class="examples">
2
+ <tr>
3
+ <th>Usage</th>
4
+ <th>
5
+ Output
6
+ </th>
7
+ </tr>
8
+ <tr>
9
+ <td>Some *data*</td>
10
+ <td>
11
+ Some more
12
+ </td>
13
+ </tr>
14
+ </table>
@@ -0,0 +1 @@
1
+ <p>This is &hellip; something &ldquo;to remember&rdquo;!</p>
@@ -0,0 +1 @@
1
+ <p>This is &hellip; something &ldquo;to remember&rdquo;!</p>
@@ -23,10 +23,8 @@ This should be output
23
23
  <p> *as* is
24
24
  </p> and nothing should be done
25
25
  about it
26
- <script>
27
-
28
-
26
+ </not>
27
+ </p>
29
28
  </script>
30
29
 
31
- &lt;http://example.com&gt;
32
- </script>
30
+ <p><a href="http://example.com">http://example.com</a></p>
@@ -22,7 +22,6 @@ This should be output
22
22
  <p> *as* is
23
23
  </p> and nothing should be done
24
24
  about it
25
- <script>
26
25
  </not>
27
26
  </p>
28
27
  </script>
@@ -0,0 +1,18 @@
1
+ Some para.
2
+
3
+ \begin{quote}
4
+ blockquote
5
+
6
+
7
+ \end{quote}
8
+ \begin{itemize}
9
+ \item a list
10
+ with some text
11
+
12
+ \end{itemize}
13
+ \begin{itemize}
14
+ \item other list
15
+
16
+ \end{itemize}
17
+ \begin{verbatim}code
18
+ \end{verbatim}
@@ -0,0 +1,6 @@
1
+ This is a footnote\footnote{Some text.
2
+
3
+ }. And another\footnote{Some other text.
4
+
5
+ }.
6
+
@@ -0,0 +1,32 @@
1
+ This is some *ref.\footnote{Some foot note text
2
+
3
+ }
4
+
5
+ \begin{quote}
6
+ a blockquote \footnote{other text
7
+ with more lines
8
+
9
+ \begin{quote}
10
+ and a quote
11
+
12
+
13
+ \end{quote}
14
+ }
15
+
16
+
17
+ \end{quote}
18
+ \begin{itemize}
19
+ \item and a list item \footnote{some \emph{text}
20
+
21
+ }
22
+
23
+ \end{itemize}
24
+ \section*{And a header\footnote{\begin{verbatim}code block
25
+ continued here
26
+ \end{verbatim}
27
+ }}
28
+
29
+ A marker without a definition [\^{}without].
30
+
31
+ A marker \footnote{} used twice[\^{}fn].
32
+
@@ -0,0 +1 @@
1
+ <p>This is <span>some text</span></p>
@@ -0,0 +1 @@
1
+ This is <span>some text
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kramdown
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ hash: -1600059249532544559
5
+ prerelease: false
6
+ segments:
7
+ - 0
8
+ - 8
9
+ - 0
10
+ version: 0.8.0
5
11
  platform: ruby
6
12
  authors:
7
13
  - Thomas Leitner
@@ -9,7 +15,7 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2010-05-07 00:00:00 +02:00
18
+ date: 2010-06-08 00:00:00 +02:00
13
19
  default_executable: kramdown
14
20
  dependencies: []
15
21
 
@@ -33,6 +39,7 @@ files:
33
39
  - AUTHORS
34
40
  - VERSION
35
41
  - ChangeLog
42
+ - CONTRIBUTERS
36
43
  - bin/kramdown
37
44
  - benchmark/timing.sh
38
45
  - benchmark/historic-ruby-1.9.2dev.dat
@@ -51,6 +58,8 @@ files:
51
58
  - benchmark/testing.sh
52
59
  - benchmark/benchmark.rb
53
60
  - lib/kramdown.rb
61
+ - lib/kramdown/parser/base.rb
62
+ - lib/kramdown/parser/html.rb
54
63
  - lib/kramdown/parser/kramdown.rb
55
64
  - lib/kramdown/parser/kramdown/abbreviation.rb
56
65
  - lib/kramdown/parser/kramdown/smart_quotes.rb
@@ -92,6 +101,7 @@ files:
92
101
  - doc/quickref.page
93
102
  - doc/news.page
94
103
  - doc/news.feed
104
+ - doc/documentation.page
95
105
  - doc/links.markdown
96
106
  - doc/tests.page
97
107
  - doc/index.page
@@ -108,6 +118,8 @@ files:
108
118
  - test/testcases/span/05_html/normal.html
109
119
  - test/testcases/span/05_html/markdown_attr.text
110
120
  - test/testcases/span/05_html/across_lines.text
121
+ - test/testcases/span/05_html/invalid.html
122
+ - test/testcases/span/05_html/invalid.text
111
123
  - test/testcases/span/05_html/across_lines.html
112
124
  - test/testcases/span/05_html/normal.text
113
125
  - test/testcases/span/escaped_chars/normal.html
@@ -125,8 +137,11 @@ files:
125
137
  - test/testcases/span/04_footnote/definitions.text
126
138
  - test/testcases/span/04_footnote/footnote_nr.text
127
139
  - test/testcases/span/04_footnote/footnote_nr.html
140
+ - test/testcases/span/04_footnote/footnote_nr.latex
128
141
  - test/testcases/span/04_footnote/markers.text
129
142
  - test/testcases/span/04_footnote/markers.html
143
+ - test/testcases/span/04_footnote/definitions.latex
144
+ - test/testcases/span/04_footnote/markers.latex
130
145
  - test/testcases/span/04_footnote/footnote_nr.options
131
146
  - test/testcases/span/04_footnote/definitions.html
132
147
  - test/testcases/span/01_link/image_in_a.text
@@ -216,6 +231,32 @@ files:
216
231
  - test/testcases/block/09_html/parse_as_span.html
217
232
  - test/testcases/block/09_html/invalid_html_2.html
218
233
  - test/testcases/block/09_html/html_and_codeblocks.html
234
+ - test/testcases/block/09_html/html_to_native/emphasis.text
235
+ - test/testcases/block/09_html/html_to_native/options
236
+ - test/testcases/block/09_html/html_to_native/comment.text
237
+ - test/testcases/block/09_html/html_to_native/list_ol.text
238
+ - test/testcases/block/09_html/html_to_native/list_dl.html
239
+ - test/testcases/block/09_html/html_to_native/table_simple.text
240
+ - test/testcases/block/09_html/html_to_native/table_normal.text
241
+ - test/testcases/block/09_html/html_to_native/typography.html
242
+ - test/testcases/block/09_html/html_to_native/list_dl.text
243
+ - test/testcases/block/09_html/html_to_native/paragraph.html
244
+ - test/testcases/block/09_html/html_to_native/paragraph.text
245
+ - test/testcases/block/09_html/html_to_native/code.text
246
+ - test/testcases/block/09_html/html_to_native/header.html
247
+ - test/testcases/block/09_html/html_to_native/list_ul.html
248
+ - test/testcases/block/09_html/html_to_native/entity.html
249
+ - test/testcases/block/09_html/html_to_native/typography.text
250
+ - test/testcases/block/09_html/html_to_native/header.text
251
+ - test/testcases/block/09_html/html_to_native/code.html
252
+ - test/testcases/block/09_html/html_to_native/emphasis.html
253
+ - test/testcases/block/09_html/html_to_native/entity.text
254
+ - test/testcases/block/09_html/html_to_native/comment.html
255
+ - test/testcases/block/09_html/html_to_native/table_simple.html
256
+ - test/testcases/block/09_html/html_to_native/header.options
257
+ - test/testcases/block/09_html/html_to_native/list_ul.text
258
+ - test/testcases/block/09_html/html_to_native/list_ol.html
259
+ - test/testcases/block/09_html/html_to_native/table_normal.html
219
260
  - test/testcases/block/09_html/filtered_html.text
220
261
  - test/testcases/block/09_html/invalid_html_2.text
221
262
  - test/testcases/block/09_html/markdown_attr.html
@@ -360,21 +401,27 @@ rdoc_options:
360
401
  require_paths:
361
402
  - lib
362
403
  required_ruby_version: !ruby/object:Gem::Requirement
404
+ none: false
363
405
  requirements:
364
406
  - - ">="
365
407
  - !ruby/object:Gem::Version
408
+ hash: -780558437635548252
409
+ segments:
410
+ - 0
366
411
  version: "0"
367
- version:
368
412
  required_rubygems_version: !ruby/object:Gem::Requirement
413
+ none: false
369
414
  requirements:
370
415
  - - ">="
371
416
  - !ruby/object:Gem::Version
417
+ hash: -780558437635548252
418
+ segments:
419
+ - 0
372
420
  version: "0"
373
- version:
374
421
  requirements: []
375
422
 
376
423
  rubyforge_project: kramdown
377
- rubygems_version: 1.3.4
424
+ rubygems_version: 1.3.7
378
425
  signing_key:
379
426
  specification_version: 3
380
427
  summary: kramdown is a fast, pure-Ruby Markdown-superset converter.