Skip to content

Commit 9ef4934

Browse files
committed
Use alt text when formatting headers with an rdoc-image.
1 parent 05d0540 commit 9ef4934

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/rdoc/markup/heading.rb

+7-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,13 @@ def label context = nil
6666
# element.
6767

6868
def plain_html
69-
self.class.to_html.to_html(text.dup)
69+
text = self.text.dup
70+
71+
if text.match?(/rdoc-image:[^:]+:(.*)/)
72+
text = text.match(/rdoc-image:[^:]+:(.*)/)[1]
73+
end
74+
75+
self.class.to_html.to_html(text)
7076
end
7177

7278
def pretty_print q # :nodoc:

0 commit comments

Comments
 (0)