phpBB3 导入脚本的增强请求

看起来很棘手,但您可能可以通过修改此处的此方法获得成功:

用这个代替:

text.gsub!(attachment_regexp) do
        index = $1.to_i
        real_filename = $2
        unreferenced_attachments[index] = nil
        attachments.fetch(index, real_filename)
end

您会想要类似这样的东西:

text.gsub!(attachment_regexp) do
        index = $1.to_i
        description = $2.strip
        unreferenced_attachments[index] = nil

        url = attachments.fetch(index, description)

        "![#{description}](#{url})"
end

这只是一个未经测试的示例,用来说明需要修改的位置。我可能是错的。

如果我明天有时间,我可能会提交一个带有真正解决方案的拉取请求 (PR)。:grinning_face_with_smiling_eyes:

5 个赞