mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-11-01 09:54:05 +09:00
Rebuild every attachment before editing a message
The editor keeps an attachment's content as it finds it, so a hand-written embed with a url but no href reached the editor with its markup unvalidated, and a mention saved under Trix's editor carried the generic octet-stream content type the editor doesn't permit and was dropped on save. Rebuilding each attachment from its attachable renders the hardened preview partial and restores the mention content type.
This commit is contained in:
1 parent
eab554aa4b
commit
6acad0549d
5 files changed
+81
-10
No files matched your search
@@ -1,6 +1,12 @@
|
||||
module User::Mentionable
|
||||
include ActionText::Attachable
|
||||
|
||||
MENTION_CONTENT_TYPE = "application/vnd.campfire.mention"
|
||||
|
||||
def attachable_content_type
|
||||
MENTION_CONTENT_TYPE
|
||||
end
|
||||
|
||||
def to_attachable_partial_path
|
||||
"users/mention"
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user