string_master 0.3.14 → 0.3.15

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: 431021c95e1590a2e91741b553284643638eb890
4
- data.tar.gz: 1eb8c2749f0b3dd632b6111cddcb8eea331e80c5
3
+ metadata.gz: 19b5af399f219345039bcd4ec0f325bcdce72c5e
4
+ data.tar.gz: 164b109fdbe76b7c8d4dbb4d3f4c60fc958dce17
5
5
  SHA512:
6
- metadata.gz: a23c1385ff7af63bba165e1e2444e1edf7a82d036a270057fb24b20f4cb886eac6bc13c3a8092bca21acb8914376b0cb1ea915d05456750b7e44026ac4477c0e
7
- data.tar.gz: 400d7f879565361048a23c89f88e4c504e504b537454e2d0a792ac6a2b0b078c45db2de26ef6ff74973b2a84dda2e65efc1178b41adea5299be7a42764cd6dc3
6
+ metadata.gz: 37be7730f2e9b4b92d9d436346b8f8100b4bfd7fd853ba17dd571d8119a559ae394211de0efe171f9d9ab23412ff9b80dfaa3a6dac0027c89360582e251bab7f
7
+ data.tar.gz: 6706ffa60f78748a8888db2dea80ee48532e207c3cddee66d357366caaee67865d1dd48f2f156002d8ebb7447f3a697320ed0f44d9f301e3115d39ea0056deff
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.14
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[^>]*?)?>/) do |tag|
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> &lt;b&gt;world&lt;/b&gt;'
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> &lt;b&gt;world&lt;/b&gt;<br/><br>'
22
+
20
23
  parser = StringMaster.new('xsstest<input/onfocus=prompt(document.cookie) autofocus>')
21
24
  parser.html_escape.to_s.should == 'xsstest&lt;input/onfocus=prompt(document.cookie) autofocus&gt;'
22
25
 
@@ -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.14 ruby lib
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.14"
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"]
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.14
4
+ version: 0.3.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Roman Snitko