jeremy-RedCloth 4.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (57) hide show
  1. data/CHANGELOG +135 -0
  2. data/COPYING +18 -0
  3. data/Manifest +56 -0
  4. data/README +171 -0
  5. data/Rakefile +205 -0
  6. data/bin/redcloth +28 -0
  7. data/ext/mingw-rbconfig.rb +176 -0
  8. data/ext/redcloth_scan/extconf.rb +9 -0
  9. data/ext/redcloth_scan/redcloth.h +178 -0
  10. data/ext/redcloth_scan/redcloth_attributes.c.rl +56 -0
  11. data/ext/redcloth_scan/redcloth_attributes.java.rl +96 -0
  12. data/ext/redcloth_scan/redcloth_attributes.rl +33 -0
  13. data/ext/redcloth_scan/redcloth_common.c.rl +18 -0
  14. data/ext/redcloth_scan/redcloth_common.java.rl +18 -0
  15. data/ext/redcloth_scan/redcloth_common.rl +111 -0
  16. data/ext/redcloth_scan/redcloth_inline.c.rl +159 -0
  17. data/ext/redcloth_scan/redcloth_inline.java.rl +108 -0
  18. data/ext/redcloth_scan/redcloth_inline.rl +159 -0
  19. data/ext/redcloth_scan/redcloth_scan.c.rl +237 -0
  20. data/ext/redcloth_scan/redcloth_scan.java.rl +573 -0
  21. data/ext/redcloth_scan/redcloth_scan.rl +325 -0
  22. data/extras/ragel_profiler.rb +73 -0
  23. data/lib/case_sensitive_require/RedCloth.rb +6 -0
  24. data/lib/redcloth.rb +37 -0
  25. data/lib/redcloth/erb_extension.rb +27 -0
  26. data/lib/redcloth/formatters/base.rb +57 -0
  27. data/lib/redcloth/formatters/html.rb +353 -0
  28. data/lib/redcloth/formatters/latex.rb +275 -0
  29. data/lib/redcloth/formatters/latex_entities.yml +2414 -0
  30. data/lib/redcloth/textile_doc.rb +103 -0
  31. data/lib/redcloth/version.rb +28 -0
  32. data/setup.rb +1585 -0
  33. data/test/basic.yml +922 -0
  34. data/test/code.yml +229 -0
  35. data/test/definitions.yml +82 -0
  36. data/test/extra_whitespace.yml +64 -0
  37. data/test/filter_html.yml +177 -0
  38. data/test/filter_pba.yml +20 -0
  39. data/test/helper.rb +108 -0
  40. data/test/html.yml +311 -0
  41. data/test/images.yml +254 -0
  42. data/test/instiki.yml +38 -0
  43. data/test/links.yml +275 -0
  44. data/test/lists.yml +283 -0
  45. data/test/poignant.yml +89 -0
  46. data/test/sanitize_html.yml +42 -0
  47. data/test/table.yml +336 -0
  48. data/test/test_custom_tags.rb +58 -0
  49. data/test/test_erb.rb +13 -0
  50. data/test/test_extensions.rb +31 -0
  51. data/test/test_formatters.rb +24 -0
  52. data/test/test_parser.rb +73 -0
  53. data/test/test_restrictions.rb +41 -0
  54. data/test/textism.yml +480 -0
  55. data/test/threshold.yml +772 -0
  56. data/test/validate_fixtures.rb +74 -0
  57. metadata +133 -0
@@ -0,0 +1,74 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require File.join(File.dirname(__FILE__), 'helper')
4
+
5
+ require 'erb'
6
+ require 'w3c_validators'
7
+
8
+ class ValidateFixtures < Test::Unit::TestCase
9
+ include W3CValidators
10
+
11
+ def setup
12
+ @v = MarkupValidator.new
13
+ sleep 1 # delay per WC3 request
14
+ end
15
+
16
+ HTML_4_0_TEMPLATE = <<EOD
17
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
18
+ <html>
19
+ <head>
20
+ <title><%= test_name %></title>
21
+ </head>
22
+ <body>
23
+ <%= content %>
24
+ </body>
25
+ </html>
26
+ EOD
27
+ XHTML_1_0_TEMPLATE = <<EOD
28
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
29
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
30
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
31
+ <head>
32
+ <title><%= test_name %></title>
33
+ </head>
34
+ <body>
35
+ <%= content %>
36
+ </body>
37
+ </html>
38
+ EOD
39
+
40
+ fixtures.each do |name, doc|
41
+ if doc['html'] && (doc['valid_html'].nil? || doc['valid_html'])
42
+ define_method("test_html_output_validity_of_#{name}") do
43
+ assert_produces_valid_html(name, doc['html'])
44
+ end
45
+ define_method("test_xhtml_output_validity_of_#{name}") do
46
+ assert_produces_valid_xhtml(name, doc['html'])
47
+ end
48
+ end
49
+ end
50
+
51
+ private
52
+ def assert_produces_valid_html(test_name, content)
53
+ body = ERB.new(HTML_4_0_TEMPLATE, nil,'-%').result(binding)
54
+ assert_validates(body)
55
+ end
56
+
57
+ def assert_produces_valid_xhtml(test_name, content)
58
+ body = ERB.new(XHTML_1_0_TEMPLATE, nil,'-%').result(binding)
59
+ assert_validates(body)
60
+ end
61
+
62
+ def assert_validates(body)
63
+ results = @v.validate_text(body)
64
+ errors = results.errors
65
+ warnings = results.warnings.reject {|w| w.message_id == "247" } # NET-enabling start-tag requires SHORTTAG YES.
66
+
67
+ assert(errors.empty?, "Validator errors: \n" +
68
+ errors.collect {|e| "'#{e.to_s}'"}.join("\n"))
69
+
70
+ assert(warnings.empty?, "Validator warnings: \n" +
71
+ warnings.collect {|w| "'#{w.to_s}'"}.join("\n"))
72
+ end
73
+
74
+ end
metadata ADDED
@@ -0,0 +1,133 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jeremy-RedCloth
3
+ version: !ruby/object:Gem::Version
4
+ version: 4.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Jason Garber
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+
12
+ date: 2009-02-06 00:00:00 -08:00
13
+ default_executable: redcloth
14
+ dependencies: []
15
+
16
+ description: RedCloth-4.1.1 - Textile parser for Ruby. http://redcloth.org/
17
+ email: redcloth-upwards@rubyforge.org
18
+ executables:
19
+ - redcloth
20
+ extensions:
21
+ - ext/redcloth_scan/extconf.rb
22
+ extra_rdoc_files:
23
+ - CHANGELOG
24
+ - lib/case_sensitive_require/RedCloth.rb
25
+ - lib/redcloth/erb_extension.rb
26
+ - lib/redcloth/formatters/base.rb
27
+ - lib/redcloth/formatters/html.rb
28
+ - lib/redcloth/formatters/latex.rb
29
+ - lib/redcloth/textile_doc.rb
30
+ - lib/redcloth/version.rb
31
+ - lib/redcloth.rb
32
+ - README
33
+ files:
34
+ - bin/redcloth
35
+ - CHANGELOG
36
+ - COPYING
37
+ - ext/mingw-rbconfig.rb
38
+ - ext/redcloth_scan/extconf.rb
39
+ - ext/redcloth_scan/redcloth.h
40
+ - ext/redcloth_scan/redcloth_attributes.c.rl
41
+ - ext/redcloth_scan/redcloth_attributes.java.rl
42
+ - ext/redcloth_scan/redcloth_attributes.rl
43
+ - ext/redcloth_scan/redcloth_common.c.rl
44
+ - ext/redcloth_scan/redcloth_common.java.rl
45
+ - ext/redcloth_scan/redcloth_common.rl
46
+ - ext/redcloth_scan/redcloth_inline.c.rl
47
+ - ext/redcloth_scan/redcloth_inline.java.rl
48
+ - ext/redcloth_scan/redcloth_inline.rl
49
+ - ext/redcloth_scan/redcloth_scan.c.rl
50
+ - ext/redcloth_scan/redcloth_scan.java.rl
51
+ - ext/redcloth_scan/redcloth_scan.rl
52
+ - extras/ragel_profiler.rb
53
+ - lib/case_sensitive_require/RedCloth.rb
54
+ - lib/redcloth/erb_extension.rb
55
+ - lib/redcloth/formatters/base.rb
56
+ - lib/redcloth/formatters/html.rb
57
+ - lib/redcloth/formatters/latex.rb
58
+ - lib/redcloth/formatters/latex_entities.yml
59
+ - lib/redcloth/textile_doc.rb
60
+ - lib/redcloth/version.rb
61
+ - lib/redcloth.rb
62
+ - Manifest
63
+ - Rakefile
64
+ - README
65
+ - setup.rb
66
+ - test/basic.yml
67
+ - test/code.yml
68
+ - test/definitions.yml
69
+ - test/extra_whitespace.yml
70
+ - test/filter_html.yml
71
+ - test/filter_pba.yml
72
+ - test/helper.rb
73
+ - test/html.yml
74
+ - test/images.yml
75
+ - test/instiki.yml
76
+ - test/links.yml
77
+ - test/lists.yml
78
+ - test/poignant.yml
79
+ - test/sanitize_html.yml
80
+ - test/table.yml
81
+ - test/test_custom_tags.rb
82
+ - test/test_erb.rb
83
+ - test/test_extensions.rb
84
+ - test/test_formatters.rb
85
+ - test/test_parser.rb
86
+ - test/test_restrictions.rb
87
+ - test/textism.yml
88
+ - test/threshold.yml
89
+ - test/validate_fixtures.rb
90
+ - RedCloth.gemspec
91
+ - ext/redcloth_scan/redcloth_attributes.c
92
+ - ext/redcloth_scan/redcloth_inline.c
93
+ - ext/redcloth_scan/redcloth_scan.c
94
+ has_rdoc: true
95
+ homepage: http://redcloth.org
96
+ post_install_message:
97
+ rdoc_options:
98
+ - --line-numbers
99
+ - --inline-source
100
+ - --title
101
+ - RedCloth
102
+ - --main
103
+ - README
104
+ require_paths:
105
+ - lib
106
+ - ext
107
+ - lib/case_sensitive_require
108
+ required_ruby_version: !ruby/object:Gem::Requirement
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ version: 1.8.4
113
+ version:
114
+ required_rubygems_version: !ruby/object:Gem::Requirement
115
+ requirements:
116
+ - - ">="
117
+ - !ruby/object:Gem::Version
118
+ version: "1.2"
119
+ version:
120
+ requirements: []
121
+
122
+ rubyforge_project: redcloth
123
+ rubygems_version: 1.2.0
124
+ signing_key:
125
+ specification_version: 2
126
+ summary: RedCloth-4.1.1 - Textile parser for Ruby. http://redcloth.org/
127
+ test_files:
128
+ - test/test_custom_tags.rb
129
+ - test/test_erb.rb
130
+ - test/test_extensions.rb
131
+ - test/test_formatters.rb
132
+ - test/test_parser.rb
133
+ - test/test_restrictions.rb