v0.21.1 Convert Gossamer inline image syntax to \![url](url)

This commit is contained in:
David Sainty 2024-06-29 00:30:16 +10:00
parent 171159cba2
commit c8677aaf0f

View File

@ -1,5 +1,5 @@
# gossamer threads migration-import code
# v0.21
# v0.21.1
require 'mysql2'
require 'open-uri'
@ -687,8 +687,8 @@ class GossamerForumsImporter < ImportScripts::Base
# Remove unsupported tags
sanitized_message.gsub!(/\[.*?\]/, '')
# Convert inline image syntax from `!(url)` to `![image](url)`
sanitized_message.gsub!(/!\((http[s]?:\/\/[^\)]+)\)/, '![image](\1)')
# Convert inline image syntax from `!(url)` to `![url](url)`
sanitized_message.gsub!(/!\((http[s]?:\/\/[^\)]+)\)/, '![\1](\1)')
sanitized_message
end