mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-11 01:14:30 +08:00
Fix tinymce assets render in report
This commit is contained in:
parent
ba50b19986
commit
1f02fb4bc7
1 changed files with 2 additions and 3 deletions
|
@ -18,9 +18,8 @@ module TinyMceImages
|
|||
description = TinyMceAsset.update_old_tinymce(description, self)
|
||||
|
||||
tiny_mce_assets.each do |tm_asset|
|
||||
tm_asset_key = tm_asset.preview.key
|
||||
encoded_tm_asset = Base64.strict_encode64(tm_asset.image.service.download(tm_asset_key))
|
||||
new_tm_asset_src = "data:image/jpg;base64,#{encoded_tm_asset}"
|
||||
next unless tm_asset&.image&.attached?
|
||||
new_tm_asset_src = tm_asset.convert_variant_to_base64(tm_asset.preview)
|
||||
html_description = Nokogiri::HTML(description)
|
||||
tm_asset_to_update = html_description.css(
|
||||
"img[data-mce-token=\"#{Base62.encode(tm_asset.id)}\"]"
|
||||
|
|
Loading…
Reference in a new issue