I'm using the TinyMCE 4.0.11 and it seems there is a Problem with the TinyMCE, because it adds a "data-mce-src" attribute to the img tag, which overwrites the "src" attribute. If i add an image with src attribute set to "http://example.com/img.jpg", the data-mce-src attribute contains "/http://example.com/img.jpg" with the "/" at the beginning. How can i prevent the tinymce adding the data-mce-src attribute?
I tried the following options for the TinyMCE configuration:
Nothing fixed the problem.
The TinyMCE getContent and setContent methods You can do this using the getContent() API method. Let's say you have initialized the editor on a textarea with id=”myTextarea”. This will return the content in the editor marked up as HTML.
tinyMCE. execCommand('mceInsertContent', false, '<img alt="Smiley face" height="42" width="42" src="' + sr + '"/>'); to insert the image in tinyMCE after extracting the URL from the image's src . Note that you need to pass the CSS style of the image to tinyMCE in the command.
This question solved this issue for me with tinymce 4
Tinymce editor image upload plugin add full image URL
relative_urls: false,
remove_script_host: false
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With