string_master 0.3.14 → 0.3.15
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 -0
- 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: 19b5af399f219345039bcd4ec0f325bcdce72c5e
|
4
|
+
data.tar.gz: 164b109fdbe76b7c8d4dbb4d3f4c60fc958dce17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 37be7730f2e9b4b92d9d436346b8f8100b4bfd7fd853ba17dd571d8119a559ae394211de0efe171f9d9ab23412ff9b80dfaa3a6dac0027c89360582e251bab7f
|
7
|
+
data.tar.gz: 6706ffa60f78748a8888db2dea80ee48532e207c3cddee66d357366caaee67865d1dd48f2f156002d8ebb7447f3a697320ed0f44d9f301e3115d39ea0056deff
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.15
|
@@ -33,7 +33,7 @@ class StringMaster
|
|
33
33
|
def html_escape(options={})
|
34
34
|
except = options[:except] || %w()
|
35
35
|
close_tags
|
36
|
-
@modified_string.gsub!(/<\/?([^<]*?)(\s[^>]*?)
|
36
|
+
@modified_string.gsub!(/<\/?([^<]*?)(\s[^>]*?)?\/?>/) do |tag|
|
37
37
|
if except.include?($1)
|
38
38
|
# sanitize attributes
|
39
39
|
tag.gsub(/\s(.+?)=('|").*?\2(?=.*?>)/) do |a|
|
@@ -17,6 +17,9 @@ describe StringMaster do
|
|
17
17
|
parser = StringMaster.new('<a href="https://google.com">hello</a> <b>world</b>')
|
18
18
|
parser.html_escape(:except => %w(a)).to_s.should == '<a href="https://google.com">hello</a> <b>world</b>'
|
19
19
|
|
20
|
+
parser = StringMaster.new('<a href="https://google.com">hello</a> <b>world</b><br/><br>')
|
21
|
+
parser.html_escape(:except => %w(a br)).to_s.should == '<a href="https://google.com">hello</a> <b>world</b><br/><br>'
|
22
|
+
|
20
23
|
parser = StringMaster.new('xsstest<input/onfocus=prompt(document.cookie) autofocus>')
|
21
24
|
parser.html_escape.to_s.should == 'xsstest<input/onfocus=prompt(document.cookie) autofocus>'
|
22
25
|
|
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.15 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.15"
|
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"]
|