Files
docuseal/lib/markdown_to_html.rb
T
Pete Matsyburka 8f3a203994 markdown link
2025-06-19 12:45:44 +03:00

14 lines
279 B
Ruby

# 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