threedaymonk-l10nizer 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,6 +1,6 @@
1
1
  grammar HtmlErb
2
2
  rule document
3
- (html_comment / javascript / erb_control / whitespace / text / tag)* <Document>
3
+ (html_comment / javascript / style / erb_control / whitespace / text / tag)* <Document>
4
4
  end
5
5
 
6
6
  rule html_comment
@@ -11,6 +11,10 @@ grammar HtmlErb
11
11
  "<script" ([^<] / "<" [^/] / "</" [^s] / "</s" [^c] / "</sc" [^r] / "</scr" [^i] / "</scri" [^p] / "</scrip" [^t] / "</script" [^>"])* "</script>"
12
12
  end
13
13
 
14
+ rule style
15
+ "<style" ([^<] / "<" [^/] / "</" [^s] / "</s" [^t] / "</st" [^y] / "</sty" [^l] / "</styl" [^e] / "</style" [^>"])* "</style>"
16
+ end
17
+
14
18
  rule erb_control
15
19
  "<%" [^=] ruby_code "%>"
16
20
  end
@@ -2,7 +2,7 @@ module L10nizer #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 8
5
+ TINY = 9
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -81,6 +81,12 @@ class ProcessorTest < Test::Unit::TestCase
81
81
  assert_equal html, l10nizer.reformed
82
82
  end
83
83
 
84
+ should "not try to localise inline styles" do
85
+ html = %{<style type="text/css">\nhtml.js .nojs {display: none; background:#fff!important;}\n</style>}
86
+ l10nizer = L10nizer::Processor.new(html, DumbKeyGenerator.new)
87
+ assert_equal html, l10nizer.reformed
88
+ end
89
+
84
90
  should "not try to localise control inside a tag" do
85
91
  html = %{<div class="user-skills block <% unless @user.skills.any? %>blank<% end %>">}
86
92
  l10nizer = L10nizer::Processor.new(html, DumbKeyGenerator.new)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: threedaymonk-l10nizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Battley
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-08-04 00:00:00 -07:00
12
+ date: 2009-08-20 00:00:00 -07:00
13
13
  default_executable: l10nizer
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency