wovnrb 1.0.9 → 1.0.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wovnrb/version.rb +1 -1
- data/lib/wovnrb.rb +2 -2
- data/test/lib/wovnrb_test.rb +6 -21
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cc73d9dfe2ed5ef29f35c27e352fae25af5cb4b
|
4
|
+
data.tar.gz: 793854cea59a84a8e486326fde09526ab38c2e63
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c211b45755b7f3e728eb8a5a0d852e627b3137d7de1ffb68322b2ea3b31fa8b5127c1b2d477a989a8a9315d58855d49340c0a50a838a0b91248dc2c0d7cca5d
|
7
|
+
data.tar.gz: 9aa78cdedf10dd61e2da3a394fd3fc37585c845e69c10e0562f08e6f282e9ea65e22749e983d8d5c02e97ae3c951b2ede5a5a063a4ebb3a7f3ffd815924c0721
|
data/lib/wovnrb/version.rb
CHANGED
data/lib/wovnrb.rb
CHANGED
@@ -105,7 +105,7 @@ module Wovnrb
|
|
105
105
|
# If this page has wovn-ignore in the html tag, don't do anything
|
106
106
|
if ignore_all || !d.xpath('//html[@wovn-ignore]').empty? || is_amp_page?(d)
|
107
107
|
ignore_all = true
|
108
|
-
output = d.to_html.gsub(/href="([^"]*)"/) { |m| "href=\"#{URI.decode($1)}\"" }
|
108
|
+
output = d.to_html(save_with: 0).gsub(/href="([^"]*)"/) { |m| "href=\"#{URI.decode($1)}\"" }
|
109
109
|
put_back_noscripts!(output, noscripts)
|
110
110
|
new_body.push(output)
|
111
111
|
next
|
@@ -115,7 +115,7 @@ module Wovnrb
|
|
115
115
|
output = lang.switch_dom_lang(d, @store, values, url, headers)
|
116
116
|
else
|
117
117
|
ScriptReplacer.new(@store).replace(d, lang)
|
118
|
-
output = d.to_html
|
118
|
+
output = d.to_html(save_with: 0)
|
119
119
|
end
|
120
120
|
put_back_noscripts!(output, noscripts)
|
121
121
|
new_body.push(output)
|
data/test/lib/wovnrb_test.rb
CHANGED
@@ -182,16 +182,9 @@ class WovnrbTest < Minitest::Test
|
|
182
182
|
url = h.url
|
183
183
|
swapped_body = i.switch_lang([body], values, url, 'ja', h)
|
184
184
|
|
185
|
-
expected_body = "<html>
|
186
|
-
<head>
|
187
|
-
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
|
188
|
-
<script src=\"//j.wovn.io/1\" async=\"true\" data-wovnio=\"key=&backend=true&currentLang=ja&defaultLang=en&urlPattern=path&langCodeAliases={}&version=#{Wovnrb::VERSION}\"> </script>
|
189
|
-
</head>
|
190
|
-
<body>
|
191
|
-
<h1>Mr. Belvedere Fan Club</h1>
|
185
|
+
expected_body = "<html><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><script src=\"//j.wovn.io/1\" async=\"true\" data-wovnio=\"key=&backend=true&currentLang=ja&defaultLang=en&urlPattern=path&langCodeAliases={}&version=#{Wovnrb::VERSION}\"> </script></head><body><h1>Mr. Belvedere Fan Club</h1>
|
192
186
|
<div><p>Hello</p></div>
|
193
|
-
</body>
|
194
|
-
</html>
|
187
|
+
</body></html>
|
195
188
|
"
|
196
189
|
assert_equal([expected_body], swapped_body)
|
197
190
|
end
|
@@ -209,18 +202,13 @@ class WovnrbTest < Minitest::Test
|
|
209
202
|
</html>
|
210
203
|
HTML
|
211
204
|
expected_body = <<HTML
|
212
|
-
<html amp="">
|
213
|
-
<head>
|
214
|
-
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">
|
215
|
-
<noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
|
216
|
-
</head>
|
205
|
+
<html amp=""><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript></head>
|
217
206
|
<body>
|
218
207
|
<h1>Mr. Belvedere Fan Club</h1>
|
219
208
|
<div><p>Hello</p></div>
|
220
209
|
|
221
210
|
|
222
|
-
</body>
|
223
|
-
</html>
|
211
|
+
</body></html>
|
224
212
|
HTML
|
225
213
|
values = generate_values
|
226
214
|
url = headers.url
|
@@ -241,15 +229,12 @@ HTML
|
|
241
229
|
</html>
|
242
230
|
HTML
|
243
231
|
expected_body = <<HTML
|
244
|
-
<html ⚡="">
|
245
|
-
<head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head>
|
246
|
-
<body>
|
232
|
+
<html ⚡=""><head><meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"></head><body>
|
247
233
|
<h1>Mr. Belvedere Fan Club</h1>
|
248
234
|
<div><p>Hello</p></div>
|
249
235
|
|
250
236
|
|
251
|
-
</body>
|
252
|
-
</html>
|
237
|
+
</body></html>
|
253
238
|
HTML
|
254
239
|
values = generate_values
|
255
240
|
url = headers.url
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wovnrb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeff Sandford
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-09-
|
12
|
+
date: 2018-09-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: nokogumbo
|
@@ -412,7 +412,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
412
412
|
version: '0'
|
413
413
|
requirements: []
|
414
414
|
rubyforge_project:
|
415
|
-
rubygems_version: 2.
|
415
|
+
rubygems_version: 2.6.11
|
416
416
|
signing_key:
|
417
417
|
specification_version: 4
|
418
418
|
summary: Gem for WOVN.io
|