1 module RedClothArvadosLinkExtension
3 class RedClothViewBase < ActionView::Base
4 include ApplicationHelper
5 include ActionView::Helpers::UrlHelper
6 include Rails.application.routes.url_helpers
8 def helper_link_to_if_arvados_object(link, opts)
9 link_to_if_arvados_object(link, opts)
13 def refs_arvados(text)
14 text.gsub!(/"(?!\s)([^"]*\S)":(\S+)/) do
16 arvados_link = RedClothViewBase.new.helper_link_to_if_arvados_object(link, { :link_text => text })
17 arvados_link ? arvados_link : "#{text}:#{link}"
22 RedCloth.send(:include, RedClothArvadosLinkExtension)