mirror of
https://github.com/docusealco/docuseal
synced 2026-11-05 14:42:33 -05:00
render links with markdown in emails
This commit is contained in:
1 parent
660f7ab8f3
commit
5b24793f2b
2 files changed
+13
-1
No files matched your search
@@ -0,0 +1,12 @@
|
||||
# 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
|
||||
Reference in new issue
Block a user