Files
docuseal/lib/markdown_to_html.rb
T

13 lines
233 B
Ruby
Raw Normal View History

2024-03-29 21:21:04 +02:00
# frozen_string_literal: true
module MarkdownToHtml
LINK_REGEXP = %r{\[([^\]]+)\]\((https?://[^)]+)\)}
LINK_REPLACE = '<a href="\2">\1</a>'
module_function
def call(text)
text.gsub(LINK_REGEXP, LINK_REPLACE)
end
end