diff --git a/slices/admin/decorators/posts/decorator.rb b/slices/admin/decorators/posts/decorator.rb index dfee5dd..47a1c00 100644 --- a/slices/admin/decorators/posts/decorator.rb +++ b/slices/admin/decorators/posts/decorator.rb @@ -82,9 +82,9 @@ module Admin def display_title title = name if prefix_emoji - return "#{prefix_emoji} #{title}" + "#{prefix_emoji} #{title}" else - return title + title end end @@ -150,7 +150,7 @@ module Admin end def to_h - clean_content = CGI.unescapeHTML(content.gsub(/<\/?[^>]*>/, "")).strip + clean_content = Sanitize.fragment(content).strip clean_content = clean_content.gsub(prefix_emoji[0], "") if prefix_emoji { id: slug, diff --git a/slices/main/decorators/posts/decorator.rb b/slices/main/decorators/posts/decorator.rb index 91a7831..9509bf2 100644 --- a/slices/main/decorators/posts/decorator.rb +++ b/slices/main/decorators/posts/decorator.rb @@ -86,9 +86,9 @@ module Main def display_title title = name if prefix_emoji - return "#{prefix_emoji} #{title}" + "#{prefix_emoji} #{title}" else - return title + title end end @@ -154,7 +154,7 @@ module Main end def to_h - clean_content = CGI.unescapeHTML(content.gsub(/<\/?[^>]*>/, "")).strip + clean_content = Sanitize.fragment(content).strip clean_content = clean_content.gsub(prefix_emoji[0], "") if prefix_emoji { id: slug, diff --git a/slices/micropub/queries/posts/syndication_url_to_source.rb b/slices/micropub/queries/posts/syndication_url_to_source.rb index cc8a6d4..a441ea3 100644 --- a/slices/micropub/queries/posts/syndication_url_to_source.rb +++ b/slices/micropub/queries/posts/syndication_url_to_source.rb @@ -3,16 +3,16 @@ module Micropub module Posts class SyndicationUrlToSource def call(url:) - if url.match("https://social.dnitza.com") + if url.match?(/https:\/\/((social)\.)dnitza.com/) return :mastodon end - if url.match("https://bsky.social") + if url.match?("https://bsky.social") return :bluesky end - if url.match("https://gist.github.com") - return :gist + if url.match?(/https:\/\/((gist)\.)?github\.com/) + :gist end end end