Finish taking the multiple issues which Discourse had with the very large number of posts in this particular topic
This commit is contained in:
		@@ -1056,11 +1056,6 @@ class GossamerForumsImporter < ImportScripts::Base
 | 
				
			|||||||
    # Remove ![http://data:image/, etc. as this is not supported.
 | 
					    # Remove ![http://data:image/, etc. as this is not supported.
 | 
				
			||||||
    sanitized_message.gsub!(/!\[data:image\/[^\]]+\]\([^)]+\)/, '')
 | 
					    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
 | 
					    # Ensure sentence structure
 | 
				
			||||||
    unless sanitized_message.match?(/[.!?]\s|[.!?]$/)
 | 
					    unless sanitized_message.match?(/[.!?]\s|[.!?]$/)
 | 
				
			||||||
      sanitized_message += "."
 | 
					      sanitized_message += "."
 | 
				
			||||||
@@ -1084,6 +1079,11 @@ class GossamerForumsImporter < ImportScripts::Base
 | 
				
			|||||||
    # Convert inline image syntax from `!(url)` to ``
 | 
					    # Convert inline image syntax from `!(url)` to ``
 | 
				
			||||||
    sanitized_message.gsub!(/!\((http[s]?:\/\/[^\)]+)\)/, '')
 | 
					    sanitized_message.gsub!(/!\((http[s]?:\/\/[^\)]+)\)/, '')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # Ensure minimum length
 | 
				
			||||||
 | 
					    if sanitized_message.strip.empty? || sanitized_message.length < 5
 | 
				
			||||||
 | 
					      sanitized_message = "Empty post contents."
 | 
				
			||||||
 | 
					    end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    sanitized_message
 | 
					    sanitized_message
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user