string_master 0.3.9 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/string_master/string_master.rb +1 -1
- data/spec/lib/string_master/string_master_spec.rb +3 -1
- data/string_master.gemspec +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a82692a09cefda620a2fc88697bcbc7382abfc33
|
4
|
+
data.tar.gz: 3541faa9f5b5c657d618722af5e8c646873d4857
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7fa14aa940a227d4aa6cb89895bf761a5ed89f0b6fd403ea8f7e48900bde7f60737ec0550969854ade40585eb5b34fda10efc8315546d6e03ca1d819c72bcf54
|
7
|
+
data.tar.gz: e563f83012a7ef46869f565dd17d8165f78e265ba6145ac042800396405bc7c5086c5c6ef0d52d69bdd10a49e1b7157b0679bb8dc7983840d123f67446197d87
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
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(
|
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><b>Hello</b>'
|
12
|
+
parser.html_escape(:except => %w(img)).string.should == '<img src="#"><b>Hello</b>'
|
13
13
|
parser = StringMaster.new('<i>hello</i> <b>world</b>')
|
14
14
|
parser.html_escape(:except => %w(b)).to_s.should == '<i>hello</i> <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> <b>world</b>'
|
15
17
|
end
|
16
18
|
|
17
19
|
it "makes images of urls that end with .jpg and other image extensions" do
|
data/string_master.gemspec
CHANGED
@@ -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.
|
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
|
+
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"]
|