markup_mask 0.0.0

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.
Files changed (3) hide show
  1. checksums.yaml +7 -0
  2. data/lib/markup_mask.rb +11 -0
  3. metadata +44 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 64dbee98603829423d0424c15557520871625eff
4
+ data.tar.gz: 3b601aab228ac85b4832f8bda76c3f9fed904a84
5
+ SHA512:
6
+ metadata.gz: 2e6cb2d36631146e7b78cdffe30da3de515f8980abb086433edc5bb77aa9be71208b5a1ab0681e95d702ecab433c81bfc82e3b464fb95fbf0d9768bce633bc3f
7
+ data.tar.gz: fd5343621566fd541ec909900d17637557f4ac55de537d6767552227286b843c0a46b20b66e63707f7205d2551ad1342f1beac8b288da8538a48dfcc00dbf977
@@ -0,0 +1,11 @@
1
+ class MarkupMask
2
+ def self.markup_mask(text)
3
+ tagsRegExp = /(<\/?\w+(?:(?:\s+\w+(?:\s*=\s*(?:".*?"|'.*?'|[^'">\s]+))?)+\s*|\s*)\/?>)/
4
+ nbspsRegExp = /(&nbsp;)/
5
+ jsRegExp = /(function.*?})/
6
+ @regex = Regexp.union(nbspsRegExp, tagsRegExp, jsRegExp)
7
+ unless text.nil?
8
+ @text_arr = text.split(@regex)
9
+ end
10
+ end
11
+ end
metadata ADDED
@@ -0,0 +1,44 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: markup_mask
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Stefan 'Mongoose' Hartmann
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-04-26 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description:
14
+ email: pukeahontasco@gmail.com
15
+ executables: []
16
+ extensions: []
17
+ extra_rdoc_files: []
18
+ files:
19
+ - lib/markup_mask.rb
20
+ homepage: https://github.com/schmartmann/markup_mask
21
+ licenses:
22
+ - MIT
23
+ metadata: {}
24
+ post_install_message:
25
+ rdoc_options: []
26
+ require_paths:
27
+ - lib
28
+ required_ruby_version: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - ">="
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
33
+ required_rubygems_version: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ requirements: []
39
+ rubyforge_project:
40
+ rubygems_version: 2.5.1
41
+ signing_key:
42
+ specification_version: 4
43
+ summary: Break apart strings that contain HTML markup, or JavaScript syntax
44
+ test_files: []