HtmlCodeCleaner 0.0.2 → 0.0.3
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 +4 -4
- data/lib/HtmlCodeCleaner.rb +40 -38
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa1e6237d9a69a735ae0741013117ddec55435e5
|
4
|
+
data.tar.gz: 1610dc07c4759e3016d4782948a97193eb48d38a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 238965586873679aad3ca665fad9ddb397afa6d6e5cf61a963448847ef180e2adf6eedf268ca59fd3532c6c0d5a86d2732845baea32119b23eb8ca0bc2531906
|
7
|
+
data.tar.gz: 2a4ad41549e35e17e61f6a5786f17077cbbf742c9ec7d3f1dcd405b2a2db255aca7609b21b72f71e81eff5fa41f70c0134f4d4842648a69bfad180e32c476759
|
data/lib/HtmlCodeCleaner.rb
CHANGED
@@ -10,12 +10,14 @@ class HtmlCodeCleaner
|
|
10
10
|
def self.clean_string(string)
|
11
11
|
if (string != nil)
|
12
12
|
# This is the dictionary containing the html code and it's replacement symbol.
|
13
|
-
dict = [
|
14
|
-
|
13
|
+
dict = [
|
14
|
+
[' '," "],
|
15
|
+
['!',"!"],
|
16
|
+
['"','"'], ['"','"'],
|
15
17
|
['#','#'],
|
16
18
|
['$',"$"],
|
17
19
|
['%',"%"],
|
18
|
-
['&',"&"],
|
20
|
+
['&',"&"], ['&',"&"],
|
19
21
|
[''',"'"],
|
20
22
|
['(',"("],
|
21
23
|
[')',")"],
|
@@ -37,9 +39,9 @@ class HtmlCodeCleaner
|
|
37
39
|
['9',"9"],
|
38
40
|
[':',":"],
|
39
41
|
[';',";"],
|
40
|
-
['<',"<"],
|
42
|
+
['<',"<"], ['<',"<"],
|
41
43
|
['=',"="],
|
42
|
-
['>',">"],
|
44
|
+
['>',">"], ['>',">"],
|
43
45
|
['?',"?"],
|
44
46
|
['@',"@"],
|
45
47
|
['A',"A"], ['a',"a"],
|
@@ -110,38 +112,38 @@ class HtmlCodeCleaner
|
|
110
112
|
[''," "],
|
111
113
|
['ž',"ž"],
|
112
114
|
['Ÿ',"Ÿ"],
|
113
|
-
[' '," "],
|
114
|
-
['¡',"¡"],
|
115
|
-
['¢',"¢"],
|
116
|
-
['£',"£"],
|
117
|
-
['¤',"¤"],
|
118
|
-
['¥',"¥"],
|
119
|
-
['¦',"¦"],
|
120
|
-
['§',"§"],
|
121
|
-
['¨',"¨"],
|
122
|
-
['©',"©"],
|
123
|
-
['ª',"ª"],
|
124
|
-
['«',"«"],
|
125
|
-
['¬',"¬"],
|
126
|
-
['­',""],
|
127
|
-
['®',"®"],
|
128
|
-
['¯',"¯"],
|
129
|
-
['°',"°"],
|
130
|
-
['±',"±"],
|
131
|
-
['²',"²"],
|
132
|
-
['³',"³"],
|
133
|
-
['´',"´"],
|
134
|
-
['µ',"µ"],
|
135
|
-
['¶',"¶"],
|
136
|
-
['·',"·"],
|
137
|
-
['¸',"¸"],
|
138
|
-
['¹',"¹"],
|
139
|
-
['º',"º"],
|
140
|
-
['»',"»"],
|
141
|
-
['¼',"¼"],
|
142
|
-
['½',"½"],
|
143
|
-
['¾',"¾"],
|
144
|
-
['¿',"¿"],
|
115
|
+
[' '," "], [' '," "],
|
116
|
+
['¡',"¡"], ['¡',"¡"],
|
117
|
+
['¢',"¢"], ['¢',"¢"],
|
118
|
+
['£',"£"], ['£',"£"],
|
119
|
+
['¤',"¤"], ['¤',"¤"],
|
120
|
+
['¥',"¥"], ['¥',"¥"],
|
121
|
+
['¦',"¦"], ['¦',"¦"],
|
122
|
+
['§',"§"], ['§',"§"],
|
123
|
+
['¨',"¨"], ['¨',"¨"],
|
124
|
+
['©',"©"], ['©',"©"],
|
125
|
+
['ª',"ª"], ['ª',"ª"],
|
126
|
+
['«',"«"], ['«',"«"],
|
127
|
+
['¬',"¬"], ['¬',"¬"],
|
128
|
+
['­',""], ['­',""],
|
129
|
+
['®',"®"], ['®',"®"],
|
130
|
+
['¯',"¯"], ['¯',"¯"],
|
131
|
+
['°',"°"], ['°',"°"],
|
132
|
+
['±',"±"], ['±',"±"],
|
133
|
+
['²',"²"], ['²',"²"],
|
134
|
+
['³',"³"], ['³',"³"],
|
135
|
+
['´',"´"], ['´',"´"],
|
136
|
+
['µ',"µ"], ['µ',"µ"],
|
137
|
+
['¶',"¶"], ['¶',"¶"],
|
138
|
+
['·',"·"], ['·',"·"],
|
139
|
+
['¸',"¸"], ['¸',"¸"],
|
140
|
+
['¹',"¹"], ['¹',"¹"],
|
141
|
+
['º',"º"], ['º',"º"],
|
142
|
+
['»',"»"], ['»',"»"],
|
143
|
+
['¼',"¼"], ['¼',"¼"],
|
144
|
+
['½',"½"], ['½',"½"],
|
145
|
+
['¾',"¾"], ['¾',"¾"],
|
146
|
+
['¿',"¿"], ['¿',"¿"],
|
145
147
|
['À',"À"],
|
146
148
|
['Á',"Á"],
|
147
149
|
['Â',"Â"],
|
@@ -225,7 +227,7 @@ class HtmlCodeCleaner
|
|
225
227
|
['•',"•"],
|
226
228
|
['…',"…"],
|
227
229
|
['‰',"‰"],
|
228
|
-
['€',"€"],
|
230
|
+
['€',"€"], ['€',"€"],
|
229
231
|
['™',"™"] ]
|
230
232
|
# Parse the string of the html code and make the replacement
|
231
233
|
dict.each { |x| string = string.gsub(x.first, x.last) }
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: HtmlCodeCleaner
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Hiland
|
@@ -42,7 +42,7 @@ requirements: []
|
|
42
42
|
rubyforge_project:
|
43
43
|
rubygems_version: 2.2.2
|
44
44
|
signing_key:
|
45
|
-
specification_version:
|
45
|
+
specification_version: 4
|
46
46
|
summary: Replace Html code with symbol
|
47
47
|
test_files:
|
48
48
|
- test/test_hcc.rb
|