DEV: Refactor helper methods for upload markdown

Follow-up to a61ff167
This commit is contained in:
Gerhard Schlager
2019-07-25 16:34:46 +02:00
parent 2ba4de2d45
commit fd12c414e7
6 changed files with 43 additions and 39 deletions

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
require_dependency 'url_helper'
require_dependency 'discourse_markdown'
require_dependency 'upload_markdown'
module ImportScripts
class Uploader
@ -40,15 +40,15 @@ module ImportScripts
end
def html_for_upload(upload, display_filename)
DiscourseMarkdown.upload_markdown(upload, display_name: display_filename)
UploadMarkdown.new(upload).to_markdown(display_name: display_filename)
end
def embedded_image_html(upload)
DiscourseMarkdown.image_markdown(upload)
UploadMarkdown.new(upload).image_markdown
end
def attachment_html(upload, display_filename)
DiscourseMarkdown.attachment_markdown(upload, display_name: display_filename)
UploadMarkdown.new(upload).attachment_markdown(display_name: display_filename)
end
private