string_master 0.3.9 → 0.3.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9014d6e022669d3f53cd4390ace1e70c6583087b
4
- data.tar.gz: 445a71c28808806e006dee990fead2da4411dd12
3
+ metadata.gz: a82692a09cefda620a2fc88697bcbc7382abfc33
4
+ data.tar.gz: 3541faa9f5b5c657d618722af5e8c646873d4857
5
5
  SHA512:
6
- metadata.gz: 8a7dd75b86a3c35b2fbd90897fdcdb8a064a6f1650402dc4461548e893fe0761b084bd4ca34f8f35134b5927040cf30ae116eec6455888d58b49944b94bfeee4
7
- data.tar.gz: f8b2bd2821bb6d6e07c4fda1fbe0b49f841424a463574efa4d4d068212756d6708667096be65222ded25626d6ed961555b3a11944895356fa6350920e58d0c95
6
+ metadata.gz: 7fa14aa940a227d4aa6cb89895bf761a5ed89f0b6fd403ea8f7e48900bde7f60737ec0550969854ade40585eb5b34fda10efc8315546d6e03ca1d819c72bcf54
7
+ data.tar.gz: e563f83012a7ef46869f565dd17d8165f78e265ba6145ac042800396405bc7c5086c5c6ef0d52d69bdd10a49e1b7157b0679bb8dc7983840d123f67446197d87
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.9
1
+ 0.3.10
@@ -36,7 +36,7 @@ class StringMaster
36
36
  @modified_string.gsub!(/<\/?([a-zA-Z0-9]*?)(\s[^>]*?)?>/) do |tag|
37
37
  if except.include?($1)
38
38
  # sanitize attributes
39
- tag.gsub(/(\s.+?)=('|").*?\2(?=.*?>)/) do |a|
39
+ tag.gsub(/\s(.+?)=('|").*?\2(?=.*?>)/) do |a|
40
40
  ["href", "src", "lang"].include?($1) ? a : ""
41
41
  end
42
42
  else
@@ -9,9 +9,11 @@ describe StringMaster do
9
9
 
10
10
  it "escapes html except for some of the allowed tags" do
11
11
  parser = StringMaster.new('<img src="#" style="border: solid 1px green;"><b>Hello</b>')
12
- parser.html_escape(:except => %w(img)).string.should == '<img>&lt;b&gt;Hello&lt;/b&gt;'
12
+ parser.html_escape(:except => %w(img)).string.should == '<img src="#">&lt;b&gt;Hello&lt;/b&gt;'
13
13
  parser = StringMaster.new('<i>hello</i> <b>world</b>')
14
14
  parser.html_escape(:except => %w(b)).to_s.should == '&lt;i&gt;hello&lt;/i&gt; <b>world</b>'
15
+ parser = StringMaster.new('<a href="http://google.com">hello</a> <b>world</b>')
16
+ parser.html_escape(:except => %w(a)).to_s.should == '<a href="http://google.com">hello</a> &lt;b&gt;world&lt;/b&gt;'
15
17
  end
16
18
 
17
19
  it "makes images of urls that end with .jpg and other image extensions" do
@@ -2,11 +2,11 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: string_master 0.3.9 ruby lib
5
+ # stub: string_master 0.3.10 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "string_master"
9
- s.version = "0.3.9"
9
+ s.version = "0.3.10"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
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.9
4
+ version: 0.3.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko