redmine_ckeditor icon indicating copy to clipboard operation
redmine_ckeditor copied to clipboard

Pasted images are not visible in Ticket preview and opened ticket

Open ghost opened this issue 6 years ago • 6 comments

When I paste an image in the editor I can see it well and have WYSIWIG-view. But it is not visible in the preview tab and not visible after saving. Additionally I can't refer to an uploaded image using redmines !image.png!. Any ideas?

ghost avatar Nov 15 '19 02:11 ghost

If you paste images directly they will be encoded and placed into html code as base64 "data" Protocol. You have to enable this protocol in the config file from CKEditor! (see example file in the plugin directory of your redmine installation/redmine_ckeditor/config/ckeditor.yml.example and edit the file with your needs and copy the file into redmine installation/config/ckeditor.yml)

allowedProtocols: .....

  • urn
  • webcal
  • xmpp - data

restart redmine/apache and you will be fine :)

ChrisUHZ avatar Nov 15 '19 14:11 ChrisUHZ

is solution dose not work( Rm4.1

MasyGreen avatar Feb 09 '20 05:02 MasyGreen

The following worked for me: Add the following line in the end of the plugins/redmine_ckeditor/init.rb file: (Loofah::VERSION >= "2.3.0" ? Loofah::HTML5::SafeList : Loofah::HTML5::WhiteList)::ALLOWED_PROTOCOLS.add('data') Restart redmine

RobertoCesar avatar Jul 02 '20 21:07 RobertoCesar

Yeah, config options don't work, but @RobertoCesar patch is OK. Is it possible to add it to the next release?

veshus avatar Jul 04 '20 15:07 veshus

Do you need add the plugins: 'pastebase64' and 'base64image' In config.js add: config.extraPlugins = 'pastebase64'; config.extraPlugins = 'base64image';

And init.rb add: (Loofah::VERSION >= "2.3.0" ? Loofah::HTML5::SafeList : Loofah::HTML5::WhiteList)::ALLOWED_PROTOCOLS.add('data')

Working perfect!

adrianobr avatar Dec 18 '20 13:12 adrianobr