Class: Plezi::Base::RenderMarkDown::NewPageLinksMDRenderer
- Inherits:
-
Redcarpet::Render::HTML
- Object
- Redcarpet::Render::HTML
- Plezi::Base::RenderMarkDown::NewPageLinksMDRenderer
- Defined in:
- lib/plezi/render/markdown.rb
Overview
A custom render engine that makes sure links to foriegn sites open in a new window/tab.
Instance Method Summary collapse
-
#link(link, title, content) ⇒ Object
review’s the link and renders the Html.
Instance Method Details
#link(link, title, content) ⇒ Object
review’s the link and renders the Html
18 19 20 |
# File 'lib/plezi/render/markdown.rb', line 18 def link(link, title, content) "<a href=\"#{link}\"#{" target='_blank'" if link =~ /^http[s]?\:\/\//}#{" title=\"#{title}\"" if title}>#{content}</a>" end |