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

3
  • I'm having the same issue, did you find any solution for this?
    – nuwaus
    Commented Dec 8, 2017 at 14:30
  • Nope... Still facing the same issue Commented Dec 14, 2017 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
    Commented Dec 14, 2017 at 12:33

1 Answer 1

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 and acknowledge you have read our privacy policy.

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