|
|
@ -5,7 +5,7 @@ class ModifyKeContentsForMarkdown < ActiveRecord::Migration[5.2]
|
|
|
|
return content if content.blank?
|
|
|
|
return content if content.blank?
|
|
|
|
s_contents = sanitize(content, tags: %w(img a span table td tr tbody pre), attributes: %w(src href target style))
|
|
|
|
s_contents = sanitize(content, tags: %w(img a span table td tr tbody pre), attributes: %w(src href target style))
|
|
|
|
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub(" ", "").gsub(/(\n)+/, "<br />")
|
|
|
|
s_contents.gsub(">\n<", "><").gsub(/^\n/, "").gsub(" ", "").gsub(/(\n)+/, "<br />")
|
|
|
|
.gsub("\t", "").gsub("\n", "").gsub(" ", " ").gsub(/(<br\s?\/?>)+/, "<br />")
|
|
|
|
.gsub("\t", "").gsub("\n", "").gsub(" ", " ").gsub(/(<br\s?\/?>)+/, "<br />")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# # 课程讨论区
|
|
|
|
# # 课程讨论区
|