Render
MissingAttachableas "☒" in plain text.Previously,
Content#to_plain_textwould replace aMissingAttachablewith a blank string. Now it renders the same "☒" character used in the HTML representation.Mike Dalessio
Add
to_markdownto Action Text, mirroringto_plain_text.Converts rich text content to Markdown, supporting headings, bold, italic, strikethrough, inline code, code blocks, blockquotes, ordered and unordered lists, links, tables, and attachments. Custom attachment representations can be provided by implementing
attachable_markdown_representationon the attachable model.= Message.create!(content: "<h1>Hello</h1><p>This is <strong>bold</strong></p>") .content.to_markdown # => "# Hello\n\nThis is **bold**"Mike Dalessio
Make ActionText::Attachable#read_attribute_for_serialization public.
Sally Hall
Install generator now detects which JS package manager to use when installing javascript dependencies for the editor.
David Lowenfels
Deprecate Trix-specific classes, modules, and methods
- ActionText::Attachable#to_trix_content_attachment_partial_path. Override
#to_editor_content_attachment_partial_pathinstead. ::ActionText::Attachments::TrixConversion- ActionText::Content#to_trix_html.
ActionText::RichText#to_trix_html.::ActionText::TrixAttachment
Sean Doyle
- ActionText::Attachable#to_trix_content_attachment_partial_path. Override
Validate
RemoteImageURLs at creation time.RemoteImage.from_nodenow validates the URL before creating aRemoteImageobject, using the same regex thatAssetUrlHelperuses during rendering. URLs like "image.png" that would previously have been passed to the asset pipeline and raised a::ActionView::Template::Errorare rejected early, and gracefully fail by resulting in aMissingAttachable.Mike Dalessio
Please check [8-1-stable]) for previous changes.