threedaymonk-l10nizer 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -36,7 +36,7 @@ grammar HtmlErb
36
36
  end
37
37
 
38
38
  rule inline_markup
39
- "<" "/"? ("em" / "strong" / "span") [^>]* ">"
39
+ "<" "/"? ("em" / "strong") [^>]* ">"
40
40
  end
41
41
 
42
42
  rule word
@@ -2,7 +2,7 @@ module L10nizer #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 4
5
+ TINY = 5
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
8
8
  end
@@ -89,12 +89,12 @@ class ProcessorTest < Test::Unit::TestCase
89
89
 
90
90
  context "when string contains inline markup" do
91
91
  setup do
92
- html = "<p>String with a <span>span</span> and <strong>strong</strong> and <em>emphasised</em> text</p>"
92
+ html = "<p>String with <strong>strong</strong> and <em>emphasised</em> text</p>"
93
93
  @l10nizer = L10nizer::Processor.new(html, lambda{ "key" })
94
94
  end
95
95
 
96
96
  should "include that markup in text" do
97
- expected = "String with a <span>span</span> and <strong>strong</strong> and <em>emphasised</em> text"
97
+ expected = "String with <strong>strong</strong> and <em>emphasised</em> text"
98
98
  assert_equal [expected], @l10nizer.l10ns.values
99
99
  end
100
100
 
@@ -104,6 +104,12 @@ class ProcessorTest < Test::Unit::TestCase
104
104
  end
105
105
  end
106
106
 
107
+ should "not consider <span> to be inline markup" do
108
+ html = %{foo <span>bar</span>}
109
+ l10nizer = L10nizer::Processor.new(html, DumbKeyGenerator.new)
110
+ assert_equal ["bar", "foo"], l10nizer.l10ns.values.sort
111
+ end
112
+
107
113
  context "when parsing a sample document" do
108
114
  setup do
109
115
  @html = File.read(File.join(File.dirname(__FILE__), "samples", "input.html.erb"))
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.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Paul Battley