diff --git a/goss-restorethread.rb b/goss-restorethread.rb index f874a67..13550bb 100644 --- a/goss-restorethread.rb +++ b/goss-restorethread.rb @@ -1056,11 +1056,6 @@ class GossamerForumsImporter < ImportScripts::Base # Remove ![http://data:image/, etc. as this is not supported. sanitized_message.gsub!(/!\[data:image\/[^\]]+\]\([^)]+\)/, '') - # Ensure minimum length - if sanitized_message.strip.empty? || sanitized_message.length < 5 - sanitized_message = "Empty post contents." - end - # Ensure sentence structure unless sanitized_message.match?(/[.!?]\s|[.!?]$/) sanitized_message += "." @@ -1084,6 +1079,11 @@ class GossamerForumsImporter < ImportScripts::Base # Convert inline image syntax from `!(url)` to `![url](url)` sanitized_message.gsub!(/!\((http[s]?:\/\/[^\)]+)\)/, '![\1](\1)') + # Ensure minimum length + if sanitized_message.strip.empty? || sanitized_message.length < 5 + sanitized_message = "Empty post contents." + end + sanitized_message end