From 8384a8a32ad1fadb2fa6c5ec4fe71312cffb9768 Mon Sep 17 00:00:00 2001 From: f Date: Mon, 25 Mar 2024 14:29:05 -0300 Subject: [PATCH 1/5] feat: darle formato al html guardado #14417 --- Gemfile | 1 + Gemfile.lock | 2 ++ app/models/metadata_content.rb | 4 +++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 466ec079..995cb849 100644 --- a/Gemfile +++ b/Gemfile @@ -76,6 +76,7 @@ gem 'webpacker' gem 'yaml_db', git: 'https://0xacab.org/sutty/yaml_db.git' gem 'kaminari' gem 'device_detector' +gem 'htmlbeautifier' # database gem 'hairtrigger' diff --git a/Gemfile.lock b/Gemfile.lock index 78563c84..862880b9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -255,6 +255,7 @@ GEM heapy (0.2.0) thor hiredis (0.6.3-x86_64-linux-musl) + htmlbeautifier (1.4.2) http_parser.rb (0.8.0-x86_64-linux-musl) httparty (0.21.0) mini_mime (>= 1.0.0) @@ -616,6 +617,7 @@ DEPENDENCIES haml-lint hamlit-rails hiredis + htmlbeautifier httparty icalendar image_processing diff --git a/app/models/metadata_content.rb b/app/models/metadata_content.rb index 761518e8..444ee2fe 100644 --- a/app/models/metadata_content.rb +++ b/app/models/metadata_content.rb @@ -1,5 +1,7 @@ # frozen_string_literal: true +require 'htmlbeautifier' + # Se encarga del contenido del artículo y quizás otros campos que # requieran texto largo. class MetadataContent < MetadataTemplate @@ -86,7 +88,7 @@ class MetadataContent < MetadataTemplate end end - html.to_s.html_safe + HtmlBeautifier.beautify(html.to_s).html_safe end # Limpia estilos en base a una lista de permitidos From 9d87da2e5436bebb812129bcef82ac41db13a354 Mon Sep 17 00:00:00 2001 From: fauno Date: Wed, 29 May 2024 19:40:17 +0000 Subject: [PATCH 2/5] ci: test [skip ci] From 50a4823dad3e1c93a2e1b34373584cbe92376941 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 31 May 2024 10:06:44 -0300 Subject: [PATCH 3/5] =?UTF-8?q?fix:=20arreglar=20migraci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20240227134845_create_fediblocks.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20240227134845_create_fediblocks.rb b/db/migrate/20240227134845_create_fediblocks.rb index 03f65f7c..1a61ccba 100644 --- a/db/migrate/20240227134845_create_fediblocks.rb +++ b/db/migrate/20240227134845_create_fediblocks.rb @@ -12,7 +12,7 @@ class CreateFediblocks < ActiveRecord::Migration[6.1] t.string :url, null: false t.string :download_url, null: false t.string :format, null: false - t.jsonb :instances, default: [] + t.jsonb :hostnames, default: [] end YAML.safe_load(File.read('db/seeds/activity_pub/fediblocks.yml')).each do |fediblock| From 78fd8c933a35fcbf839ab783bcc892d4062b57fd Mon Sep 17 00:00:00 2001 From: f Date: Fri, 31 May 2024 10:06:44 -0300 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20arreglar=20migraci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20240227134845_create_fediblocks.rb | 2 +- ...0228171335_rename_fediblock_instances_to_hostnames.rb | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) delete mode 100644 db/migrate/20240228171335_rename_fediblock_instances_to_hostnames.rb diff --git a/db/migrate/20240227134845_create_fediblocks.rb b/db/migrate/20240227134845_create_fediblocks.rb index 03f65f7c..1a61ccba 100644 --- a/db/migrate/20240227134845_create_fediblocks.rb +++ b/db/migrate/20240227134845_create_fediblocks.rb @@ -12,7 +12,7 @@ class CreateFediblocks < ActiveRecord::Migration[6.1] t.string :url, null: false t.string :download_url, null: false t.string :format, null: false - t.jsonb :instances, default: [] + t.jsonb :hostnames, default: [] end YAML.safe_load(File.read('db/seeds/activity_pub/fediblocks.yml')).each do |fediblock| diff --git a/db/migrate/20240228171335_rename_fediblock_instances_to_hostnames.rb b/db/migrate/20240228171335_rename_fediblock_instances_to_hostnames.rb deleted file mode 100644 index bad343f2..00000000 --- a/db/migrate/20240228171335_rename_fediblock_instances_to_hostnames.rb +++ /dev/null @@ -1,9 +0,0 @@ -# frozen_string_literal: true - -# Cambia el nombre de la columna para que podamos obtener todas las -# instancias de un fediblock -class RenameFediblockInstancesToHostnames < ActiveRecord::Migration[6.1] - def change - rename_column :activity_pub_fediblocks, :instances, :hostnames - end -end From 12dfd1e9e71519fd124b767085563bf76d3a659e Mon Sep 17 00:00:00 2001 From: f Date: Fri, 31 May 2024 10:16:04 -0300 Subject: [PATCH 5/5] fix: oliphant blocklist --- db/seeds/activity_pub/fediblocks.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/seeds/activity_pub/fediblocks.yml b/db/seeds/activity_pub/fediblocks.yml index c977f9bf..35fe38cd 100644 --- a/db/seeds/activity_pub/fediblocks.yml +++ b/db/seeds/activity_pub/fediblocks.yml @@ -6,7 +6,7 @@ id: "9046789a-5de8-4b16-beed-796060f8f3cc" - title: "Oliphant Tier 0" url: "https://writer.oliphant.social/oliphant/the-oliphant-social-blocklist" - download_url: "https://codeberg.org/oliphant/blocklists/raw/branch/main/blocklists/mastodon/tier0.csv" + download_url: "https://codeberg.org/oliphant/blocklists/raw/branch/main/blocklists/mastodon/seirdy-tier0.csv" format: "mastodon" id: "fc1efcb8-7e68-4a76-ae9e-0c447752b12b" - title: "The Bad Space (90%)"