mirror of
https://github.com/docusealco/docuseal
synced 2026-11-12 23:42:33 -05:00
markdown link
This commit is contained in:
1 parent
ea24562861
commit
8f3a203994
1 file changed
+3
-2
@@ -2,11 +2,12 @@
|
|||||||
|
|
||||||
module MarkdownToHtml
|
module MarkdownToHtml
|
||||||
LINK_REGEXP = %r{\[([^\]]+)\]\((https?://[^)]+)\)}
|
LINK_REGEXP = %r{\[([^\]]+)\]\((https?://[^)]+)\)}
|
||||||
LINK_REPLACE = '<a href="\2">\1</a>'
|
|
||||||
|
|
||||||
module_function
|
module_function
|
||||||
|
|
||||||
def call(text)
|
def call(text)
|
||||||
text.gsub(LINK_REGEXP, LINK_REPLACE)
|
text.gsub(LINK_REGEXP) do
|
||||||
|
ApplicationController.helpers.link_to(Regexp.last_match(1), Regexp.last_match(2))
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in new issue
Block a user