Class: Parliament::Utils::Services::ParliamentMarkdownRenderer

Inherits:
Redcarpet::Render::HTML
  • Object
show all
Defined in:
lib/parliament/utils/services/markdown_converter.rb

Instance Method Summary collapse

Instance Method Details

Overrides default autolink behaviour of redcarpet gem for instances such as video embeds

Parameters:

  • link (String)

    The link

  • link_type (Symbol)

    The link type



14
15
16
17
18
19
20
# File 'lib/parliament/utils/services/markdown_converter.rb', line 14

def autolink(link, link_type)
  if link_type == :url
    return parliament_live_video_embed(link) if link =~ /parliamentlive.tv\/event\/index\/[a-z0-9-]{36}/i
  end

  link # call super instead if we actually want autolinking
end