|
|
|
@ -31,8 +31,15 @@ class CrossPost |
|
|
|
|
parts.each { |p| last = @client.update p, in_reply_to_status: last } |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
WHITESPACE_TAGS = { |
|
|
|
|
'br' => { before: "\n", after: '' }, |
|
|
|
|
'div' => { before: "\n", after: "\n" }, |
|
|
|
|
'p' => { before: "\n", after: "\n" } |
|
|
|
|
}.freeze |
|
|
|
|
|
|
|
|
|
def post_status(status) |
|
|
|
|
content = Sanitize.clean(status.content).strip |
|
|
|
|
content = status.content |
|
|
|
|
content = Sanitize.clean(content, whitespace_elements: WHITESPACE_TAGS).strip |
|
|
|
|
content = CGI.unescape_html content |
|
|
|
|
media = status.media_attachments.collect { |f| open f.url } |
|
|
|
|
|
|
|
|
|