You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
docuseal/lib/markdown_to_html.rb

14 lines
279 B

# frozen_string_literal: true
module MarkdownToHtml
LINK_REGEXP = %r{\[([^\]]+)\]\((https?://[^)]+)\)}
module_function
def call(text)
text.gsub(LINK_REGEXP) do
ApplicationController.helpers.link_to(Regexp.last_match(1), Regexp.last_match(2))
end
end
end