string_master 0.3.3 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.3
1
+ 0.3.4
@@ -130,8 +130,8 @@ class StringMaster
130
130
  # Preserves whitespace within a given tag. Each occurence of 2 or more spaces
131
131
  # is transformed into a   entities.
132
132
  def preserve_whitespace_within(tag)
133
- @modified_string.gsub!(/<#{tag}>.+?<\/#{tag}>/) do |match|
134
- match.gsub(/\s\s+/) { |m| "&nbsp;"*m.length }
133
+ @modified_string.gsub!(/<#{tag}>(.|\n)+?<\/#{tag}>/) do |match|
134
+ match.gsub(/( )( )+/) { |m| "&nbsp;"*m.length }
135
135
  end
136
136
  self
137
137
  end
@@ -46,8 +46,8 @@ CODE
46
46
  StringMaster.new(code).wrap_code.to_s.should == <<WRAPPED_CODE
47
47
  I have a piece of code
48
48
  <code>def say_hello
49
- puts "hello world"
50
- return true
49
+ &nbsp;&nbsp;puts "hello world"
50
+ &nbsp;&nbsp;return true
51
51
  end</code>
52
52
  and here's what my code looks like.
53
53
  WRAPPED_CODE
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "string_master"
8
- s.version = "0.3.3"
8
+ s.version = "0.3.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Roman Snitko"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: string_master
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.3.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -133,7 +133,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
133
133
  version: '0'
134
134
  segments:
135
135
  - 0
136
- hash: 2244729625638070014
136
+ hash: 450096338606050278
137
137
  required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  none: false
139
139
  requirements: