dev_forum
SylorHuang 5 years ago
parent 52bf60c247
commit 6110df20bd

@ -336,6 +336,8 @@ module ApplicationHelper
def to_markdown(text) def to_markdown(text)
Rails.logger.info("#########################text______________tedxt_________________###{text}") Rails.logger.info("#########################text______________tedxt_________________###{text}")
Rails.logger.info("#########################text______________request_base_url________________###{request.base_url}")
return nil if text.blank? return nil if text.blank?
options = { options = {
:autolink => true, :autolink => true,
@ -347,10 +349,10 @@ module ApplicationHelper
:tables => true :tables => true
} }
markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,options) markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML,options)
ss = markdown.render(text) m_t = markdown.render(text)
Rails.logger.info("#########################text______________markdown.render(text)________________###{ss}") q_title = m_t &.include?("src=\"") ? m_t&.gsub("src=\"","src=\"#{@request_url}")&.html_safe : m_t
ss Rails.logger.info("#########################text______________markdown.render(text)________________###{q_title }")
q_title
end end
end end

Loading…
Cancel
Save