aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2023-03-21 12:29:11 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2023-03-21 12:29:42 -0700
commit88fba7828bcdbb9f973c0112ff4bfb926d38dc80 (patch)
tree7edba2a236f06317af0ca3e430162a2c709c2b76
parentGemfile: update charlock_holmes for newer ICU (diff)
downloadbackend-88fba7828bcdbb9f973c0112ff4bfb926d38dc80.tar.gz
backend-88fba7828bcdbb9f973c0112ff4bfb926d38dc80.tar.bz2
backend-88fba7828bcdbb9f973c0112ff4bfb926d38dc80.zip
backend: Update to Sanitize-6, cleans up nokogiri/nokogumbo dep mess
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--Gemfile7
-rw-r--r--Gemfile.lock81
-rw-r--r--lib/rendering.rb2
3 files changed, 47 insertions, 43 deletions
diff --git a/Gemfile b/Gemfile
index 8563f4a..827ff5f 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,11 +1,10 @@
source 'https://rubygems.org'
-# This contains build fixes that upstream merged but reverted for no reason.
-gem 'nokogumbo', :git => 'https://github.com/robbat2/nokogumbo', :branch => 'gentoo', :submodules => true
+# Nokogiri & Nokogumbo were required by older Sanitize
gem 'mail'
gem 'maildir'
gem 'elasticsearch'
-gem 'sanitize', '~>4.4.0'
-gem 'charlock_holmes', '~>0.7.6'
+gem 'sanitize', '~>6.0.0'
+gem 'charlock_holmes', '~>0.7.7'
gem 'parallel'
gem 'ruby-progressbar'
diff --git a/Gemfile.lock b/Gemfile.lock
index f12f104..d0b9481 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,55 +1,60 @@
-GIT
- remote: https://github.com/robbat2/nokogumbo
- revision: 3748a7e00b02978f1c55e4c5a7e01ade93df098e
- branch: gentoo
- submodules: true
- specs:
- nokogumbo (1.4.13)
- nokogiri
-
GEM
remote: https://rubygems.org/
specs:
- charlock_holmes (0.7.6)
- crass (1.0.2)
- elasticsearch (1.0.6)
- elasticsearch-api (= 1.0.6)
- elasticsearch-transport (= 1.0.6)
- elasticsearch-api (1.0.6)
+ charlock_holmes (0.7.7)
+ crass (1.0.6)
+ date (3.3.3)
+ elastic-transport (8.2.0)
+ faraday (< 3)
multi_json
- elasticsearch-transport (1.0.6)
- faraday
+ elasticsearch (8.6.0)
+ elastic-transport (~> 8)
+ elasticsearch-api (= 8.6.0)
+ elasticsearch-api (8.6.0)
multi_json
- faraday (0.9.1)
- multipart-post (>= 1.2, < 3)
- mail (2.6.3)
- mime-types (>= 1.16, < 3)
- maildir (2.2.0)
- mime-types (2.4.3)
- mini_portile2 (2.1.0)
- multi_json (1.10.1)
- multipart-post (2.0.0)
- nokogiri (1.6.8.1)
- mini_portile2 (~> 2.1.0)
- parallel (1.4.0)
- ruby-progressbar (1.7.1)
- sanitize (4.4.0)
+ faraday (2.7.4)
+ faraday-net_http (>= 2.0, < 3.1)
+ ruby2_keywords (>= 0.0.4)
+ faraday-net_http (3.0.2)
+ mail (2.8.1)
+ mini_mime (>= 0.1.1)
+ net-imap
+ net-pop
+ net-smtp
+ maildir (2.2.3)
+ mini_mime (1.1.2)
+ multi_json (1.15.0)
+ net-imap (0.3.4)
+ date
+ net-protocol
+ net-pop (0.1.2)
+ net-protocol
+ net-protocol (0.2.1)
+ timeout
+ net-smtp (0.3.3)
+ net-protocol
+ nokogiri (1.14.2-x86_64-linux)
+ racc (~> 1.4)
+ parallel (1.22.1)
+ racc (1.6.2)
+ ruby-progressbar (1.13.0)
+ ruby2_keywords (0.0.5)
+ sanitize (6.0.1)
crass (~> 1.0.2)
- nokogiri (>= 1.4.4)
- nokogumbo (~> 1.4.1)
+ nokogiri (>= 1.12.0)
+ timeout (0.3.2)
PLATFORMS
- ruby
+ x86_64-linux
DEPENDENCIES
- charlock_holmes (~> 0.7.6)
+ charlock_holmes (~> 0.7.7)
elasticsearch
mail
maildir
- nokogumbo!
parallel
ruby-progressbar
- sanitize (~> 4.4.0)
+ sanitize (~> 6.0.0)
BUNDLED WITH
- 1.13.7
+ 2.3.8
diff --git a/lib/rendering.rb b/lib/rendering.rb
index 5c164da..0a304ba 100644
--- a/lib/rendering.rb
+++ b/lib/rendering.rb
@@ -51,7 +51,7 @@ module Ag::Rendering
end
end.join.gsub("</div>\n<div class=\"ag-quote\">", "\n")
elsif content_type == 'text/html'
- '<div class="ag-html-content">' + Sanitize.clean(content, Sanitize::Config::BASIC) + '</div>'
+ '<div class="ag-html-content">' + Sanitize.fragment(content, Sanitize::Config::BASIC) + '</div>'
else
'<div class="alert alert-danger" role="alert"><strong>Unsupported Content-Type</strong></div>'
end