Fix dtext.parse_strip failing for nil (closes #2662)
This commit is contained in:
@@ -339,6 +339,8 @@ class DText
|
|||||||
end
|
end
|
||||||
|
|
||||||
def self.strip(s)
|
def self.strip(s)
|
||||||
|
return "" if s.blank?
|
||||||
|
|
||||||
s.gsub!(/[\r\n]+/m, " ")
|
s.gsub!(/[\r\n]+/m, " ")
|
||||||
s.gsub!(/\[\/?(?:b|i|s|u|tn|tr|td|th|thead|tbody|quote|code|spoilers|spoiler|expand|table)\]/, "")
|
s.gsub!(/\[\/?(?:b|i|s|u|tn|tr|td|th|thead|tbody|quote|code|spoilers|spoiler|expand|table)\]/, "")
|
||||||
s.gsub!(/\[\[([^\|\]]+)\|([^\]]+)\]\]/m, '\2')
|
s.gsub!(/\[\[([^\|\]]+)\|([^\]]+)\]\]/m, '\2')
|
||||||
|
|||||||
Reference in New Issue
Block a user