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
lib/web/tiny_mce/plugins/advimage/js/image.js
line 145 tosrc: 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