diff --git a/script/import_scripts/bespoke_1.rb b/script/import_scripts/bespoke_1.rb index bb120f98fe6f7..dd4290fbcbccd 100644 --- a/script/import_scripts/bespoke_1.rb +++ b/script/import_scripts/bespoke_1.rb @@ -160,6 +160,8 @@ def import_categories end def normalize_raw!(raw) + return "" if raw.blank? + # purple and #1223f3 raw.gsub!(/\[color=[#a-z0-9]+\]/i, "") raw.gsub!(%r{\[/color\]}i, "") diff --git a/script/import_scripts/jive.rb b/script/import_scripts/jive.rb index 7e59a0f5a01e4..3d5d2a5d82e20 100644 --- a/script/import_scripts/jive.rb +++ b/script/import_scripts/jive.rb @@ -196,6 +196,8 @@ def import_categories end def normalize_raw!(raw) + return "" if raw.blank? + raw = raw.dup raw = raw[5..-6] diff --git a/script/import_scripts/yammer.rb b/script/import_scripts/yammer.rb index 907ca4a6be8b8..f367a73cbfdf4 100644 --- a/script/import_scripts/yammer.rb +++ b/script/import_scripts/yammer.rb @@ -468,6 +468,8 @@ def import_pm_posts end def normalize_raw(raw) + return "" if raw.blank? + raw = raw.gsub('\n', "") raw.gsub!(/\[\[user:(\d+)\]\]/) do u = Regexp.last_match(1) diff --git a/script/import_scripts/zendesk.rb b/script/import_scripts/zendesk.rb index a8b5ef59ac5bc..4eb010aef62b7 100644 --- a/script/import_scripts/zendesk.rb +++ b/script/import_scripts/zendesk.rb @@ -211,6 +211,8 @@ def import_posts end def normalize_raw(raw) + return "" if raw.blank? + raw = raw.gsub('\n', "") raw = ReverseMarkdown.convert(raw) raw diff --git a/script/import_scripts/zendesk_api.rb b/script/import_scripts/zendesk_api.rb index d76ff1652dc50..ae9d948413d26 100644 --- a/script/import_scripts/zendesk_api.rb +++ b/script/import_scripts/zendesk_api.rb @@ -345,6 +345,8 @@ def import_likes end def normalize_raw(raw, user_id) + return "" if raw.blank? + raw = raw.gsub('\n', "") raw = ReverseMarkdown.convert(raw)