rails icon indicating copy to clipboard operation
rails copied to clipboard

update ContentAttachment so that it works with "content" attributes

Open jamis opened this issue 1 year ago • 0 comments

Summary

The existing ContentAttachment model is a fossil from when Action Text was first extracted from Basecamp. It is unused, and effectively broken (since the partials it references were apparently never ported from Basecamp with it). The model has no corresponding unit tests, and the file in general has not been touched almost since it was extracted from Basecamp.

However, the model has seen significant evolution in 37signals' HEY email app, where it became more versatile and useful. Instead of being restricted to simply representing a horizontal rule, it can represent arbitrary encapsulated content via a new content attribute. When the ContentAttachment is rendered, the content attribute is expanded as the body of the element.

This makes it possible for an application to embed markup in a document that would otherwise be undesirable or expensive to process. For example, an incoming email may quote a complicated bit of DOM, and while you don't want to have to process and rewrite it, you also don't want to discard it; the content attribute of ContentAttachment allows you to make that work.

Other Information

This change is intentionally not backward-compatible with the previous ContentAttachment implementation. However, I believe that the previous implementation was broken, and unused, and so I don't think there will be any user-facing visibility to this change.

jamis avatar Aug 02 '22 22:08 jamis