Skip to content

Commit 68b500e

Browse files
authored
Merge pull request rails#48142 from p8/actiontext/document-actiontext-content
Some cleanups for ActionText documentation [ci-skip]
2 parents 7b9497a + fdf9682 commit 68b500e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

actiontext/lib/action_text/attachable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
module ActionText
4-
# = Action Text Attachable
4+
# = Action Text \Attachable
55
#
66
# Include this module to make a record attachable to an <tt>ActionText::Content</tt>.
77
#

actiontext/lib/action_text/content.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def links
5353
@links ||= fragment.find_all("a[href]").map { |a| a["href"] }.uniq
5454
end
5555

56-
# Extracts ActionText::Attachments from the HTML fragment:
56+
# Extracts <tt>ActionText::Attachment</tt>s from the HTML fragment:
5757
#
5858
# attachable = ActiveStorage::Blob.first
5959
# html = %Q(<action-text-attachment sgid="#{attachable.attachable_sgid}" caption="Captioned"></action-text-attachment>)
@@ -75,12 +75,12 @@ def gallery_attachments
7575
@gallery_attachments ||= attachment_galleries.flat_map(&:attachments)
7676
end
7777

78-
# Extracts ActionText::Attachables from the HTML fragment:
78+
# Extracts <tt>ActionText::Attachable</tt>s from the HTML fragment:
7979
#
8080
# attachable = ActiveStorage::Blob.first
8181
# html = %Q(<action-text-attachment sgid="#{attachable.attachable_sgid}" caption="Captioned"></action-text-attachment>)
8282
# content = ActionText::Content.new(html)
83-
# content.attachables # => [#<ActiveStorage::Blob...
83+
# content.attachables # => [attachable]
8484
def attachables
8585
@attachables ||= attachment_nodes.map do |node|
8686
ActionText::Attachable.from_node(node)

0 commit comments

Comments
 (0)