htmlbeautifier 0.0.9 → 0.0.10

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.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: ef0b7742f4aeee06c65142a6c5cfdd735b462f94
4
+ data.tar.gz: 59a6d1b39bdc3ccf32ce4f10aa673e448802ec79
5
+ SHA512:
6
+ metadata.gz: 2133a2a77b572ca42386e4a3c3bc7d08c292962d4fe4869de237ca0a120b92fc6e2614bf927fde5ea3533864c68af756f60dcb5d3cd76067677e8593b8ad1702
7
+ data.tar.gz: cb1d72451e92bf6bd2d0a7bb74e34956c35d5b83e9f9d2e4f39e1d1d9bb75ee483f97956d2d8b2c0c39c8f41e776e1d11fd3f22f6d4c5bad6f6fc090d269c28d
@@ -26,7 +26,7 @@ module HtmlBeautifier
26
26
  :foreign_block
27
27
  p.map %r{<#{ELEMENT_CONTENT}/>}m,
28
28
  :standalone_element
29
- p.map %r{<#{HTML_VOID_ELEMENTS}#{ELEMENT_CONTENT}>}m,
29
+ p.map %r{<#{HTML_VOID_ELEMENTS}(?: #{ELEMENT_CONTENT})?>}m,
30
30
  :standalone_element
31
31
  p.map %r{</#{ELEMENT_CONTENT}>}m,
32
32
  :close_element
@@ -2,7 +2,7 @@ module HtmlBeautifier #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 9
5
+ TINY = 10
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -38,6 +38,20 @@ class TestHtmlBeautifierIntegration < Test::Unit::TestCase
38
38
  <hr />
39
39
  <% end %>
40
40
  </div>
41
+ <table>
42
+ <colgroup>
43
+ <col style="width: 50%;">
44
+ <col style="width: 50%;">
45
+ </colgroup>
46
+ <tbody>
47
+ <tr>
48
+ <td>First column</td>
49
+ </tr>
50
+ <tr>
51
+ <td>Second column</td>
52
+ </tr>
53
+ </tbody>
54
+ </table>
41
55
  </body>
42
56
  </html>
43
57
  ))
@@ -74,6 +88,20 @@ class TestHtmlBeautifierIntegration < Test::Unit::TestCase
74
88
  <hr />
75
89
  <% end %>
76
90
  </div>
91
+ <table>
92
+ <colgroup>
93
+ <col style="width: 50%;">
94
+ <col style="width: 50%;">
95
+ </colgroup>
96
+ <tbody>
97
+ <tr>
98
+ <td>First column</td>
99
+ </tr>
100
+ <tr>
101
+ <td>Second column</td>
102
+ </tr>
103
+ </tbody>
104
+ </table>
77
105
  </body>
78
106
  </html>
79
107
  ))
@@ -5,10 +5,6 @@ class HtmlBeautifierRegressionTest < Test::Unit::TestCase
5
5
 
6
6
  include HtmlBeautifierTestUtilities
7
7
 
8
- def setup
9
- # HtmlBeautifier::Parser.debug_block{ |match, method| puts("#{match.inspect} => #{method}") }
10
- end
11
-
12
8
  def test_should_ignore_html_fragments_in_embedded_code
13
9
  source = code(%q(
14
10
  <div>
@@ -267,20 +263,28 @@ class HtmlBeautifierRegressionTest < Test::Unit::TestCase
267
263
 
268
264
  def test_should_not_indent_html_void_elements
269
265
  source = code(%q(
270
- <meta>
271
- <input id="id">
272
- <br>
266
+ <meta>
267
+ <input id="id">
268
+ <br>
273
269
  ))
274
270
  assert_beautifies source, source
275
271
  end
276
272
 
277
273
  def test_should_ignore_case_of_void_elements
278
274
  source = code(%q(
279
- <META>
280
- <INPUT id="id">
281
- <BR>
275
+ <META>
276
+ <INPUT id="id">
277
+ <BR>
282
278
  ))
283
279
  assert_beautifies source, source
284
280
  end
285
281
 
282
+ def test_should_not_parse_colgroup_as_standalone
283
+ source = code(%q(
284
+ <colgroup>
285
+ <col style="width: 50%;">
286
+ </colgroup>
287
+ ))
288
+ assert_beautifies source, source
289
+ end
286
290
  end
metadata CHANGED
@@ -1,32 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: htmlbeautifier
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.9
4
+ version: 0.0.10
6
5
  platform: ruby
7
6
  authors:
8
7
  - Paul Battley
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-12-29 00:00:00.000000000 Z
11
+ date: 2014-09-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- type: :development
16
- version_requirements: !ruby/object:Gem::Requirement
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
17
16
  requirements:
18
- - - ! '>='
17
+ - - ">="
19
18
  - !ruby/object:Gem::Version
20
19
  version: '0'
21
- none: false
20
+ type: :development
22
21
  prerelease: false
23
- name: rake
24
- requirement: !ruby/object:Gem::Requirement
22
+ version_requirements: !ruby/object:Gem::Requirement
25
23
  requirements:
26
- - - ! '>='
24
+ - - ">="
27
25
  - !ruby/object:Gem::Version
28
26
  version: '0'
29
- none: false
30
27
  description: A normaliser/beautifier for HTML that also understands embedded Ruby.
31
28
  email: pbattley@gmail.com
32
29
  executables:
@@ -34,42 +31,41 @@ executables:
34
31
  extensions: []
35
32
  extra_rdoc_files: []
36
33
  files:
37
- - Rakefile
38
34
  - README.md
35
+ - Rakefile
39
36
  - bin/htmlbeautifier
40
- - test/test_html_beautifier_integration.rb
37
+ - lib/htmlbeautifier.rb
38
+ - lib/htmlbeautifier/beautifier.rb
39
+ - lib/htmlbeautifier/builder.rb
40
+ - lib/htmlbeautifier/html_parser.rb
41
+ - lib/htmlbeautifier/parser.rb
42
+ - lib/htmlbeautifier/version.rb
41
43
  - test/test_helper.rb
44
+ - test/test_html_beautifier_integration.rb
42
45
  - test/test_html_beautifier_regression.rb
43
46
  - test/test_parser.rb
44
- - lib/htmlbeautifier/version.rb
45
- - lib/htmlbeautifier/parser.rb
46
- - lib/htmlbeautifier/html_parser.rb
47
- - lib/htmlbeautifier/beautifier.rb
48
- - lib/htmlbeautifier/builder.rb
49
- - lib/htmlbeautifier.rb
50
47
  homepage: http://github.com/threedaymonk/htmlbeautifier
51
48
  licenses:
52
49
  - MIT
50
+ metadata: {}
53
51
  post_install_message:
54
52
  rdoc_options: []
55
53
  require_paths:
56
54
  - lib
57
55
  required_ruby_version: !ruby/object:Gem::Requirement
58
56
  requirements:
59
- - - ! '>='
57
+ - - ">="
60
58
  - !ruby/object:Gem::Version
61
59
  version: '0'
62
- none: false
63
60
  required_rubygems_version: !ruby/object:Gem::Requirement
64
61
  requirements:
65
- - - ! '>='
62
+ - - ">="
66
63
  - !ruby/object:Gem::Version
67
64
  version: '0'
68
- none: false
69
65
  requirements: []
70
66
  rubyforge_project:
71
- rubygems_version: 1.8.25
67
+ rubygems_version: 2.2.2
72
68
  signing_key:
73
- specification_version: 3
69
+ specification_version: 4
74
70
  summary: HTML/ERB beautifier
75
71
  test_files: []