BBRedCloth 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. data/BBRedCloth.gemspec +36 -0
  2. data/CHANGELOG +123 -0
  3. data/COPYING +18 -0
  4. data/Manifest +45 -0
  5. data/README.textile +149 -0
  6. data/Rakefile +247 -0
  7. data/bin/bbredcloth +34 -0
  8. data/ext/mingw-rbconfig.rb +176 -0
  9. data/ext/redcloth_scan/extconf.rb +9 -0
  10. data/ext/redcloth_scan/redcloth.h +196 -0
  11. data/ext/redcloth_scan/redcloth_attributes.c +655 -0
  12. data/ext/redcloth_scan/redcloth_bbcode.c +2457 -0
  13. data/ext/redcloth_scan/redcloth_bbcode_inline.c +1890 -0
  14. data/ext/redcloth_scan/redcloth_inline.c +12387 -0
  15. data/ext/redcloth_scan/redcloth_scan.c +10848 -0
  16. data/extras/ragel_profiler.rb +73 -0
  17. data/lib/case_sensitive_require/RedCloth.rb +6 -0
  18. data/lib/redcloth/erb_extension.rb +27 -0
  19. data/lib/redcloth/formatters/base.rb +57 -0
  20. data/lib/redcloth/formatters/html.rb +487 -0
  21. data/lib/redcloth/formatters/latex.rb +249 -0
  22. data/lib/redcloth/formatters/latex_entities.yml +2414 -0
  23. data/lib/redcloth/textile_doc.rb +196 -0
  24. data/lib/redcloth/version.rb +28 -0
  25. data/lib/redcloth.rb +37 -0
  26. data/setup.rb +1585 -0
  27. data/test/basic.yml +933 -0
  28. data/test/code.yml +229 -0
  29. data/test/definitions.yml +82 -0
  30. data/test/extra_whitespace.yml +64 -0
  31. data/test/filter_html.yml +177 -0
  32. data/test/filter_pba.yml +20 -0
  33. data/test/helper.rb +109 -0
  34. data/test/html.yml +313 -0
  35. data/test/images.yml +254 -0
  36. data/test/instiki.yml +38 -0
  37. data/test/links.yml +275 -0
  38. data/test/lists.yml +283 -0
  39. data/test/poignant.yml +89 -0
  40. data/test/sanitize_html.yml +42 -0
  41. data/test/table.yml +267 -0
  42. data/test/test_custom_tags.rb +46 -0
  43. data/test/test_erb.rb +13 -0
  44. data/test/test_extensions.rb +31 -0
  45. data/test/test_formatters.rb +24 -0
  46. data/test/test_parser.rb +73 -0
  47. data/test/test_restrictions.rb +61 -0
  48. data/test/textism.yml +484 -0
  49. data/test/threshold.yml +772 -0
  50. data/test/validate_fixtures.rb +74 -0
  51. metadata +139 -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,139 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: BBRedCloth
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 8
8
+ - 0
9
+ version: 0.8.0
10
+ platform: ruby
11
+ authors:
12
+ - Ryan Alyea
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2010-09-12 00:00:00 -07:00
18
+ default_executable:
19
+ dependencies: []
20
+
21
+ description: |-
22
+ BBRedCloth-0.8.0 - Textile parser for Ruby. Includes BBCode additions.
23
+ http://redcloth.org/
24
+ email: ryan@fangamer.com
25
+ executables:
26
+ - bbredcloth
27
+ extensions:
28
+ - ext/redcloth_scan/extconf.rb
29
+ extra_rdoc_files:
30
+ - CHANGELOG
31
+ - lib/case_sensitive_require/RedCloth.rb
32
+ - lib/redcloth/erb_extension.rb
33
+ - lib/redcloth/formatters/base.rb
34
+ - lib/redcloth/formatters/html.rb
35
+ - lib/redcloth/formatters/latex.rb
36
+ - lib/redcloth/textile_doc.rb
37
+ - lib/redcloth/version.rb
38
+ - lib/redcloth.rb
39
+ - README.textile
40
+ files:
41
+ - bin/bbredcloth
42
+ - CHANGELOG
43
+ - COPYING
44
+ - ext/mingw-rbconfig.rb
45
+ - ext/redcloth_scan/extconf.rb
46
+ - ext/redcloth_scan/redcloth.h
47
+ - extras/ragel_profiler.rb
48
+ - lib/case_sensitive_require/RedCloth.rb
49
+ - lib/redcloth/erb_extension.rb
50
+ - lib/redcloth/formatters/base.rb
51
+ - lib/redcloth/formatters/html.rb
52
+ - lib/redcloth/formatters/latex.rb
53
+ - lib/redcloth/formatters/latex_entities.yml
54
+ - lib/redcloth/textile_doc.rb
55
+ - lib/redcloth/version.rb
56
+ - lib/redcloth.rb
57
+ - Manifest
58
+ - Rakefile
59
+ - README.textile
60
+ - setup.rb
61
+ - test/basic.yml
62
+ - test/code.yml
63
+ - test/definitions.yml
64
+ - test/extra_whitespace.yml
65
+ - test/filter_html.yml
66
+ - test/filter_pba.yml
67
+ - test/helper.rb
68
+ - test/html.yml
69
+ - test/images.yml
70
+ - test/instiki.yml
71
+ - test/links.yml
72
+ - test/lists.yml
73
+ - test/poignant.yml
74
+ - test/sanitize_html.yml
75
+ - test/table.yml
76
+ - test/test_custom_tags.rb
77
+ - test/test_erb.rb
78
+ - test/test_extensions.rb
79
+ - test/test_formatters.rb
80
+ - test/test_parser.rb
81
+ - test/test_restrictions.rb
82
+ - test/textism.yml
83
+ - test/threshold.yml
84
+ - test/validate_fixtures.rb
85
+ - BBRedCloth.gemspec
86
+ - ext/redcloth_scan/redcloth_attributes.c
87
+ - ext/redcloth_scan/redcloth_inline.c
88
+ - ext/redcloth_scan/redcloth_scan.c
89
+ - ext/redcloth_scan/redcloth_bbcode.c
90
+ - ext/redcloth_scan/redcloth_bbcode_inline.c
91
+ has_rdoc: true
92
+ homepage: http://redcloth.org
93
+ licenses: []
94
+
95
+ post_install_message:
96
+ rdoc_options:
97
+ - --line-numbers
98
+ - --inline-source
99
+ - --title
100
+ - BBRedCloth
101
+ - --main
102
+ - README.textile
103
+ require_paths:
104
+ - lib
105
+ - ext
106
+ - lib/case_sensitive_require
107
+ required_ruby_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ segments:
113
+ - 1
114
+ - 8
115
+ - 4
116
+ version: 1.8.4
117
+ required_rubygems_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ segments:
123
+ - 1
124
+ - 2
125
+ version: "1.2"
126
+ requirements: []
127
+
128
+ rubyforge_project: bbredcloth
129
+ rubygems_version: 1.3.7
130
+ signing_key:
131
+ specification_version: 3
132
+ summary: BBRedCloth-0.8.0 - Textile parser for Ruby. Includes BBCode additions. http://redcloth.org/
133
+ test_files:
134
+ - test/test_custom_tags.rb
135
+ - test/test_erb.rb
136
+ - test/test_extensions.rb
137
+ - test/test_formatters.rb
138
+ - test/test_parser.rb
139
+ - test/test_restrictions.rb