docomo_css 0.2.4 → 0.2.5

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -17,6 +17,8 @@ docomo_css works around this by inlining all CSS automatically for you.
17
17
 
18
18
  sudo gem install docomo_css
19
19
 
20
+ libxml 2.7 or later is required
21
+
20
22
  == Usage
21
23
 
22
24
  # app/controllers/articles_controller.rb
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.4
1
+ 0.2.5
data/docomo_css.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
2
+ # DO NOT EDIT THIS FILE
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run `rake gemspec`
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{docomo_css}
8
- s.version = "0.2.4"
8
+ s.version = "0.2.5"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["milk1000cc", "Paul McMahon"]
12
- s.date = %q{2010-09-21}
12
+ s.date = %q{2010-09-29}
13
13
  s.description = %q{Inlines CSS so that you can use external CSS with docomo handsets.}
14
14
  s.email = %q{info@milk1000.cc}
15
15
  s.extra_rdoc_files = [
@@ -58,4 +58,3 @@ Gem::Specification.new do |s|
58
58
  s.add_dependency(%q<tiny_css>, [">= 0"])
59
59
  end
60
60
  end
61
-
data/lib/docomo_css.rb CHANGED
@@ -34,7 +34,7 @@ module DocomoCss
34
34
  embed_pseudo_style(doc, extract_pseudo_style(css))
35
35
  embed_style(doc, css)
36
36
  end
37
- xml_declare(doc) + doc.to_xhtml(:indent => 0)
37
+ xml_declare(doc) + doc.to_xhtml(:indent => 0, :encoding => doc.encoding)
38
38
  end
39
39
 
40
40
  def xml_declare(doc)
@@ -67,11 +67,11 @@ module DocomoCss
67
67
  end
68
68
 
69
69
  def escape_numeric_character_reference(text)
70
- text.gsub /&#(\d+);/, 'HTMLCSSINLINERESCAPE\1::::::::'
70
+ text.gsub /&#(\d+|x[\da-fA-F]+);/, 'HTMLCSSINLINERESCAPE\1::::::::'
71
71
  end
72
72
 
73
73
  def unescape_numeric_character_reference(text)
74
- text.gsub /HTMLCSSINLINERESCAPE(\d+)::::::::/, '&#\1;'
74
+ text.gsub /HTMLCSSINLINERESCAPE(\d+|x[\da-fA-F]+)::::::::/, '&#\1;'
75
75
  end
76
76
 
77
77
  def stylesheet_link_node(document)
@@ -22,10 +22,12 @@ class DocomoCssTest < Test::Unit::TestCase
22
22
 
23
23
  def test_escape_numeric_character_reference
24
24
  assert_equal "HTMLCSSINLINERESCAPE123456789::::::::", @filter.escape_numeric_character_reference("&#123456789;")
25
+ assert_equal "HTMLCSSINLINERESCAPEx123def::::::::", @filter.escape_numeric_character_reference("&#x123def;")
25
26
  end
26
27
 
27
28
  def test_unescape_numeric_character_reference
28
29
  assert_equal "&#123456789;", @filter.unescape_numeric_character_reference("HTMLCSSINLINERESCAPE123456789::::::::")
30
+ assert_equal "&#x123def;", @filter.unescape_numeric_character_reference("HTMLCSSINLINERESCAPEx123def::::::::")
29
31
  end
30
32
 
31
33
  def test_pseudo_selectors
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: docomo_css
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
4
+ hash: 29
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 4
10
- version: 0.2.4
9
+ - 5
10
+ version: 0.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - milk1000cc
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2010-09-21 00:00:00 +09:00
19
+ date: 2010-09-29 00:00:00 +09:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency