diff options
author | Connor Shea <connor.james.shea@gmail.com> | 2016-11-23 02:43:33 +0300 |
---|---|---|
committer | Connor Shea <connor.james.shea@gmail.com> | 2016-11-23 02:43:33 +0300 |
commit | 72df50d34a8d17e0ca66883ffcb36887852dfaa1 (patch) | |
tree | 94eeeffde6e707a6428a46340d4ca3b84e892296 /lib | |
parent | 8c590df5e77f9fc657137ad7b2f5b3c233f56d73 (diff) | |
parent | 34234ee41b47cba8189f7eaec0f6997bf42fc893 (diff) |
Merge branch 'image-links' into 'master'
Add links to all images.
Fixes #42.
See merge request !29
Diffstat (limited to 'lib')
-rw-r--r-- | lib/helpers_.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/helpers_.rb b/lib/helpers_.rb index b9a560f0..a136ea99 100644 --- a/lib/helpers_.rb +++ b/lib/helpers_.rb @@ -16,4 +16,8 @@ class HTML < Redcarpet::Render::HTML "<h#{header_level} id='#{anchor}'>#{text} <a class='anchor' href='##{anchor}' title='Permalink'>¶</a></h#{header_level}>" end + + def image(link, title, alt_text) + %(<a target="_blank" href="#{link}"><img src="#{link}" title="#{title}" alt="#{alt_text}"/></a>) + end end |