Specific decoration for statuses on index page
This commit is contained in:
22
slices/main/decorators/statuses/decorator.rb
Normal file
22
slices/main/decorators/statuses/decorator.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: false
|
||||
|
||||
# auto_register: false
|
||||
|
||||
require "rexml/parsers/pullparser"
|
||||
require "sanitize"
|
||||
require "nokogiri"
|
||||
|
||||
module Main
|
||||
module Decorators
|
||||
module Statuses
|
||||
class Decorator < Main::Decorators::Posts::Decorator
|
||||
def raw_content
|
||||
Sanitize.fragment(content,
|
||||
elements: ["img", "p"],
|
||||
attributes: {"img" => ["alt", "src", "title"]}
|
||||
)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user