dev_forum
SylorHuang 5 years ago
parent 52bf60c247
commit 6110df20bd

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

Loading…
Cancel
Save