From 8f3a203994362a32eff68b04f44ba49826160652 Mon Sep 17 00:00:00 2001 From: Pete Matsyburka Date: Thu, 19 Jun 2025 12:42:44 +0300 Subject: [PATCH] markdown link --- lib/markdown_to_html.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/markdown_to_html.rb b/lib/markdown_to_html.rb index c66b88b1..e9d04f75 100644 --- a/lib/markdown_to_html.rb +++ b/lib/markdown_to_html.rb @@ -2,11 +2,12 @@ module MarkdownToHtml LINK_REGEXP = %r{\[([^\]]+)\]\((https?://[^)]+)\)} - LINK_REPLACE = '\1' module_function 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