1

The TinyMce editor adds %20 before the image url.

Expected output

<p><img src="{{media url="wysiwyg/pdf/pdf.png"}}" /></p>

Output

<p><img src="%20%20%20%20{{media url="wysiwyg/pdf/pdf.png"}}" /></p>

I've tried adding rep(/%20/gi,""); in lib/web/tiny_mce/plugins/bbcode/editor_plugin_src.js:87

  • I'm having the same issue, did you find any solution for this? – nuwaus Dec 8 '17 at 14:30
  • Nope... Still facing the same issue – Frank Groot Dec 14 '17 at 9:36
  • I found the solution, Change your lib/web/tiny_mce/plugins/advimage/js/image.js line 145 to src: nl.src.value.trim().replace(/ /g, '%20'), so it will trim the white space from left and right of the string. please note that if you update it this fix will be overridden, so I still looking for a proper override method. – nuwaus Dec 14 '17 at 12:33
1

I found a temporary solution for this, Change your

lib/web/tiny_mce/plugins/advimage/js/image.js

line 145

to

src: nl.src.value.trim().replace(/ /g, '%20'),

so it will trim the white space from left and right of the string.

Please note that if you update, this fix will be overridden, so I still looking for a proper override method.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.