kramdown 0.2.0 → 0.3.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 (67) hide show
  1. data/ChangeLog +267 -0
  2. data/VERSION +1 -1
  3. data/benchmark/benchmark.rb +2 -1
  4. data/benchmark/generate_data.rb +110 -0
  5. data/benchmark/historic-jruby-1.4.0.dat +7 -0
  6. data/benchmark/historic-ruby-1.8.6.dat +7 -0
  7. data/benchmark/historic-ruby-1.8.7.dat +7 -0
  8. data/benchmark/historic-ruby-1.9.1p243.dat +7 -0
  9. data/benchmark/historic-ruby-1.9.2dev.dat +7 -0
  10. data/benchmark/static-jruby-1.4.0.dat +7 -0
  11. data/benchmark/static-ruby-1.8.6.dat +7 -0
  12. data/benchmark/static-ruby-1.8.7.dat +7 -0
  13. data/benchmark/static-ruby-1.9.1p243.dat +7 -0
  14. data/benchmark/static-ruby-1.9.2dev.dat +7 -0
  15. data/benchmark/testing.sh +1 -1
  16. data/doc/index.page +5 -5
  17. data/doc/installation.page +3 -3
  18. data/doc/quickref.page +3 -3
  19. data/doc/syntax.page +133 -101
  20. data/doc/tests.page +9 -1
  21. data/lib/kramdown/compatibility.rb +34 -0
  22. data/lib/kramdown/converter.rb +26 -8
  23. data/lib/kramdown/document.rb +2 -1
  24. data/lib/kramdown/parser.rb +1 -1192
  25. data/lib/kramdown/parser/kramdown.rb +272 -0
  26. data/lib/kramdown/parser/kramdown/attribute_list.rb +102 -0
  27. data/lib/kramdown/parser/kramdown/autolink.rb +42 -0
  28. data/lib/kramdown/parser/kramdown/blank_line.rb +43 -0
  29. data/lib/kramdown/parser/kramdown/blockquote.rb +42 -0
  30. data/lib/kramdown/parser/kramdown/codeblock.rb +62 -0
  31. data/lib/kramdown/parser/kramdown/codespan.rb +57 -0
  32. data/lib/kramdown/parser/kramdown/emphasis.rb +69 -0
  33. data/lib/kramdown/parser/kramdown/eob.rb +39 -0
  34. data/lib/kramdown/parser/kramdown/escaped_chars.rb +38 -0
  35. data/lib/kramdown/parser/kramdown/extension.rb +65 -0
  36. data/lib/kramdown/parser/kramdown/footnote.rb +72 -0
  37. data/lib/kramdown/parser/kramdown/header.rb +81 -0
  38. data/lib/kramdown/parser/kramdown/horizontal_rule.rb +39 -0
  39. data/lib/kramdown/parser/kramdown/html.rb +253 -0
  40. data/lib/kramdown/{deprecated.rb → parser/kramdown/html_entity.rb} +10 -12
  41. data/lib/kramdown/parser/kramdown/line_break.rb +38 -0
  42. data/lib/kramdown/parser/kramdown/link.rb +153 -0
  43. data/lib/kramdown/parser/kramdown/list.rb +225 -0
  44. data/lib/kramdown/parser/kramdown/paragraph.rb +44 -0
  45. data/lib/kramdown/parser/kramdown/typographic_symbol.rb +48 -0
  46. data/lib/kramdown/version.rb +1 -1
  47. data/test/testcases/block/09_html/comment.html +1 -0
  48. data/test/testcases/block/09_html/comment.text +1 -1
  49. data/test/testcases/block/09_html/content_model/tables.text +2 -2
  50. data/test/testcases/block/09_html/not_parsed.html +10 -0
  51. data/test/testcases/block/09_html/not_parsed.text +9 -0
  52. data/test/testcases/block/09_html/parse_as_raw.html +4 -0
  53. data/test/testcases/block/09_html/parse_as_raw.text +2 -0
  54. data/test/testcases/block/09_html/parse_block_html.html +4 -0
  55. data/test/testcases/block/09_html/parse_block_html.text +3 -0
  56. data/test/testcases/block/09_html/processing_instruction.html +1 -0
  57. data/test/testcases/block/09_html/processing_instruction.text +1 -1
  58. data/test/testcases/block/09_html/simple.html +8 -15
  59. data/test/testcases/block/09_html/simple.text +2 -12
  60. data/test/testcases/span/02_emphasis/normal.html +8 -4
  61. data/test/testcases/span/02_emphasis/normal.text +6 -2
  62. data/test/testcases/span/05_html/markdown_attr.html +2 -1
  63. data/test/testcases/span/05_html/markdown_attr.text +2 -1
  64. data/test/testcases/span/05_html/normal.html +6 -2
  65. data/test/testcases/span/05_html/normal.text +4 -0
  66. metadata +35 -4
  67. data/lib/kramdown/parser/registry.rb +0 -62
@@ -23,25 +23,15 @@ foo
23
23
  </div>
24
24
  <div style="&nbsp;"></div>
25
25
  </div>
26
- <div>bar&nbsp;</div>
26
+ <div>bar&nbsp;
27
+ </div>
27
28
  </div>
28
29
 
29
30
  para5
30
31
 
31
- <div>id</div>
32
-
33
32
  <div>id
34
33
  </div> test
35
34
 
36
- <div>hallo</p><div>test</div>
37
- hallo
38
- </div>
39
-
40
- <div>hallo<div>test
41
- hallo
42
- </div>
43
- </div></p>
44
-
45
35
  <div>
46
36
  hallo
47
37
  </div> <div>
@@ -2,13 +2,17 @@
2
2
 
3
3
  <p>This <em>is</em> so <strong>hard</strong> too.</p>
4
4
 
5
- <p><em>At</em> start.</p>
5
+ <p><em>At</em> start
6
+ <em>At</em> start</p>
6
7
 
7
- <p>At <em>end</em></p>
8
+ <p>At <em>end</em>
9
+ At <em>end</em></p>
8
10
 
9
- <p><em>At</em> start.</p>
11
+ <p><em>At</em> start
12
+ <em>At</em> start</p>
10
13
 
11
- <p>At <em>end</em></p>
14
+ <p>At <em>end</em>
15
+ At <em>end</em></p>
12
16
 
13
17
  <p>And <em>nest<strong>ed</strong></em>.</p>
14
18
 
@@ -2,12 +2,16 @@ This *is* so **hard**.
2
2
 
3
3
  This _is_ so __hard__ too.
4
4
 
5
- *At* start.
5
+ *At* start
6
+ *At* start
6
7
 
8
+ At *end*
7
9
  At *end*
8
10
 
9
- _At_ start.
11
+ _At_ start
12
+ _At_ start
10
13
 
14
+ At _end_
11
15
  At _end_
12
16
 
13
17
  And *nest**ed***.
@@ -2,4 +2,5 @@
2
2
  This is <span>*text*</span>
3
3
  This is <span><em>text</em></span>
4
4
  This is <span><em>text</em></span>
5
- This is <span>* nothing <b markdown="1">to fear</b> about</span>.</p>
5
+ This is <span>*nothing* <b>to <strong>fear</strong></b> about</span>.
6
+ This is <span>&lt;http://example.com&gt;</span>.</p>
@@ -2,4 +2,5 @@ This is <span markdown="1">*text*</span>
2
2
  This is <span markdown="0">*text*</span>
3
3
  This is <span markdown="span">*text*</span>
4
4
  This is <span markdown="block">*text*</span>
5
- This is <span markdown="0">* nothing <b markdown="1">to fear</b> about</span>.
5
+ This is <span markdown="0">*nothing* <b markdown="1">to **fear**</b> about</span>.
6
+ This is <span markdown="0"><http://example.com></span>.
@@ -17,8 +17,12 @@ now </span>.</p>
17
17
 
18
18
  <p>Auto-closing: <br /></p>
19
19
 
20
- <p>An invalid tag: &lt;hr&gt;</p>
20
+ <p>An invalid tag: </p>
21
21
 
22
- <p>An invalid &lt;/closing&gt; tag.</p>
22
+ <p>A block tag.</p>
23
+
24
+ <p>An invalid tag.</p>
23
25
 
24
26
  <p>A <script>*not*</script> tag.</p>
27
+
28
+ <p>An <span>unclosed <em>tag.</em></span></p>
@@ -19,6 +19,10 @@ Auto-closing: <br>
19
19
 
20
20
  An invalid tag: <hr>
21
21
 
22
+ A <p>block tag</p>.
23
+
22
24
  An invalid </closing> tag.
23
25
 
24
26
  A <script>*not*</script> tag.
27
+
28
+ An <span>unclosed *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.2.0
4
+ version: 0.3.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-12-03 00:00:00 +01:00
12
+ date: 2009-12-20 00:00:00 +01:00
13
13
  default_executable: kramdown
14
14
  dependencies: []
15
15
 
@@ -35,16 +35,47 @@ files:
35
35
  - ChangeLog
36
36
  - bin/kramdown
37
37
  - benchmark/benchmark.rb
38
+ - benchmark/generate_data.rb
39
+ - benchmark/historic-jruby-1.4.0.dat
40
+ - benchmark/historic-ruby-1.8.6.dat
41
+ - benchmark/historic-ruby-1.8.7.dat
42
+ - benchmark/historic-ruby-1.9.1p243.dat
43
+ - benchmark/historic-ruby-1.9.2dev.dat
38
44
  - benchmark/mdbasics.text
39
45
  - benchmark/mdsyntax.text
46
+ - benchmark/static-jruby-1.4.0.dat
47
+ - benchmark/static-ruby-1.8.6.dat
48
+ - benchmark/static-ruby-1.8.7.dat
49
+ - benchmark/static-ruby-1.9.1p243.dat
50
+ - benchmark/static-ruby-1.9.2dev.dat
40
51
  - benchmark/testing.sh
41
52
  - benchmark/timing.sh
53
+ - lib/kramdown/compatibility.rb
42
54
  - lib/kramdown/converter.rb
43
- - lib/kramdown/deprecated.rb
44
55
  - lib/kramdown/document.rb
45
56
  - lib/kramdown/error.rb
46
57
  - lib/kramdown/extension.rb
47
- - lib/kramdown/parser/registry.rb
58
+ - lib/kramdown/parser/kramdown/attribute_list.rb
59
+ - lib/kramdown/parser/kramdown/autolink.rb
60
+ - lib/kramdown/parser/kramdown/blank_line.rb
61
+ - lib/kramdown/parser/kramdown/blockquote.rb
62
+ - lib/kramdown/parser/kramdown/codeblock.rb
63
+ - lib/kramdown/parser/kramdown/codespan.rb
64
+ - lib/kramdown/parser/kramdown/emphasis.rb
65
+ - lib/kramdown/parser/kramdown/eob.rb
66
+ - lib/kramdown/parser/kramdown/escaped_chars.rb
67
+ - lib/kramdown/parser/kramdown/extension.rb
68
+ - lib/kramdown/parser/kramdown/footnote.rb
69
+ - lib/kramdown/parser/kramdown/header.rb
70
+ - lib/kramdown/parser/kramdown/horizontal_rule.rb
71
+ - lib/kramdown/parser/kramdown/html.rb
72
+ - lib/kramdown/parser/kramdown/html_entity.rb
73
+ - lib/kramdown/parser/kramdown/line_break.rb
74
+ - lib/kramdown/parser/kramdown/link.rb
75
+ - lib/kramdown/parser/kramdown/list.rb
76
+ - lib/kramdown/parser/kramdown/paragraph.rb
77
+ - lib/kramdown/parser/kramdown/typographic_symbol.rb
78
+ - lib/kramdown/parser/kramdown.rb
48
79
  - lib/kramdown/parser.rb
49
80
  - lib/kramdown/version.rb
50
81
  - lib/kramdown.rb
@@ -1,62 +0,0 @@
1
- # -*- coding: utf-8 -*-
2
- #
3
- #--
4
- # Copyright (C) 2009 Thomas Leitner <t_leitner@gmx.at>
5
- #
6
- # This file is part of kramdown.
7
- #
8
- # kramdown is free software: you can redistribute it and/or modify
9
- # it under the terms of the GNU General Public License as published by
10
- # the Free Software Foundation, either version 3 of the License, or
11
- # (at your option) any later version.
12
- #
13
- # This program is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU General Public License
19
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
20
- #++
21
- #
22
-
23
- module Kramdown
24
- module Parser
25
-
26
- # A small helper class for storing block and span level parser methods by name.
27
- class Registry
28
-
29
- # Holds all the needed data for one block/span level parser.
30
- Data = Struct.new(:name, :type, :start_re, :module, :method)
31
-
32
- @@parsers = {}
33
-
34
- # Add a parser method
35
- #
36
- # * of type +type+ (can either be <tt>:block</tt> or <tt>:span</tt>),
37
- # * with the given +name+,
38
- # * defined in the module +mod_nam+
39
- # * and using +start_re+ as start
40
- #
41
- # to the registry. The method name is automatically derived from the +name+ or can explicitly
42
- # be set by using the +meth_name+ parameter.
43
- def self.define_parser(type, name, start_re, mod_name, meth_name = "parse_#{name}")
44
- raise "A parser with the name #{name} already exists!" if @@parsers.has_key?(name)
45
- @@parsers[name] = Data.new(name, type, start_re, mod_name, meth_name)
46
- end
47
-
48
- # Return the Data structure for the parser +name+.
49
- def self.parser(name = nil)
50
- @@parsers[name]
51
- end
52
-
53
- # Return +true+ if the Registry has a parser called +name+ of type +type+ (the usage of the
54
- # type is optional).
55
- def self.has_parser?(name, type = nil)
56
- @@parsers[name] && (type.nil? || @@parsers[name].type == type)
57
- end
58
-
59
- end
60
-
61
- end
62
- end