grover 2.0.0 → 2.0.1

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
  SHA256:
3
- metadata.gz: 4b648a18f5dde412a89f2d19732416d7846037e4e3d86b5eab201e30a3079c86
4
- data.tar.gz: ccbde1ea60e9adb699bb8836dbda73fbba6453f4e0a5193c0c1a1f73201f09b9
3
+ metadata.gz: cb5b937d91e68448cb7d33b190207dca1312046dbf29370814923bbc2a996ec9
4
+ data.tar.gz: 7816fc5566f60b7ebe17747d0a1e0b4ee562134192b1c435ab705da44bb86e6c
5
5
  SHA512:
6
- metadata.gz: 4d43ee6e339c38473da2be84cc72f87da2f9dfbc93f1d1e266f45924046b868bdacde29246d298b85debf2d598dc5c4096aba56833041386eab8eb7f4c487786
7
- data.tar.gz: e10ad55ebd9efaa7e49ccdaf6d3b36aba5842db01f4fe940e1b4ed07172e5a34346acdb85fba718dad69200511177c6faae4d1515d94da690e31134e4350aa67
6
+ metadata.gz: 03ae9f131c703dad8c92e4a00eb6543412f20f260263ec110f7b2635cc245ed4c84ee35f22449731e8805bbe881fe2fef133c50b37d5bb12edec52d79b2c19ac
7
+ data.tar.gz: 9c0591aadb74a69f51292d0a7e9e3201f72a56358dc6ca561a10624635b8a61077c773f781dc3ad2a3c62eae2f5527ce67eaba8ad6c7d7d0aa06e2f157cf6a58
@@ -81,7 +81,9 @@ class Grover
81
81
  end
82
82
 
83
83
  def call_js_method(method, url_or_html, options) # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
84
+ url_or_html = sanitize_unicode_control_characters url_or_html
84
85
  stdin.puts JSON.dump([method, url_or_html, options])
86
+
85
87
  input = stdout.gets
86
88
  raise Errno::EPIPE, "Can't read from worker" if input.nil?
87
89
 
@@ -120,5 +122,10 @@ class Grover
120
122
  stderr.close
121
123
  wait_thr.join
122
124
  end
125
+
126
+ # The line/paragraph separator characters break the JS JSON parser, so replace them with regular newlines
127
+ def sanitize_unicode_control_characters(html)
128
+ html.gsub(/[\u{2028}\u{2029}]/, "\n")
129
+ end
123
130
  end
124
131
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Grover
4
- VERSION = '2.0.0'
4
+ VERSION = '2.0.1'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grover
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Bromwich
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2026-11-02 00:00:00.000000000 Z
11
+ date: 2026-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri