Use <summary> to encode content warnings instead
This commit is contained in:
@ -42,9 +42,8 @@ module AtomBuilderHelper
|
||||
end
|
||||
|
||||
def content(xml, content, warning = nil)
|
||||
extra = { type: 'html' }
|
||||
extra[:warning] = warning unless warning.blank?
|
||||
xml.content(extra, content) unless content.blank?
|
||||
xml.summary(warning) unless warning.blank?
|
||||
xml.content({ type: 'html' }, content) unless content.blank?
|
||||
end
|
||||
|
||||
def title(xml, title)
|
||||
|
@ -16,7 +16,7 @@ class PostStatusService < BaseService
|
||||
status = account.statuses.create!(text: text,
|
||||
thread: in_reply_to,
|
||||
sensitive: options[:sensitive],
|
||||
spoiler_text: options[:spoiler_text],
|
||||
spoiler_text: options[:spoiler_text] || '',
|
||||
visibility: options[:visibility],
|
||||
application: options[:application])
|
||||
|
||||
|
@ -225,7 +225,7 @@ class ProcessFeedService < BaseService
|
||||
end
|
||||
|
||||
def content_warning(xml = @xml)
|
||||
xml.at_xpath('./xmlns:content', xmlns: TagManager::XMLNS)['warning']
|
||||
xml.at_xpath('./xmlns:summary', xmlns: TagManager::XMLNS)&.content || ''
|
||||
end
|
||||
|
||||
def published(xml = @xml)
|
||||
|
Reference in New Issue
Block a user