instance method
attachable_markdown_representation
Ruby on Rails edge
Since edgeSignature
attachable_markdown_representation(caption = nil, attachment_links: false)
No documentation comment.
Parameters
-
captionopt = nil -
attachment_linkskey = false
Source
# File actiontext/lib/action_text/engine.rb, line 63
def attachable_markdown_representation(caption = nil, attachment_links: false)
title = (caption || filename).to_s
if attachment_links
renderer = ActionText::Content.renderer
raise ArgumentError, "attachment_links requires a rendering context" unless renderer
url = renderer.url_for(self)
MarkdownConversion.markdown_link(title, url, image: image?)
else
"\\[#{MarkdownConversion.escape_markdown_text(title)}\\]"
end
end
Defined in actiontext/lib/action_text/engine.rb line 63
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionText::Engine