Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pasting HTML into inline editor clones the element #3497

Closed
infosaurus opened this issue Feb 20, 2017 · 5 comments
Closed

Pasting HTML into inline editor clones the element #3497

infosaurus opened this issue Feb 20, 2017 · 5 comments

Comments

@infosaurus
Copy link

I have the following inline editable element :

<h2 class="editable-simple mce-content-body" id="title" style="position: relative;" contenteditable="true" spellcheck="false" data-postback="Title">title</h2>

initialized with

        tinymce.init({
            selector: '.editable-simple',
            inline: true,
            toolbar: 'undo redo',
            menubar: false,
            plugins: "paste",
            paste_as_text: true
        });

In Internet Explorer, when I copy a heading from somewhere else (either a h1, h2, etc. from a web page or a heading from Word) and paste it in that editor, the <h2> element is duplicated. In other words, a second <h2> is added to the DOM and appears besides the normal one. It is editable but blank (doesn't contain pasted text) and has the same ID and attributes as the real one.

Sometimes, for instance when I repeatedly paste the heading in the editor, the same thing occurs but the inserted h2 is non-editable and contains pasted text.

paste_as_text: true is an attempt to go around that problem by preventing formatted text to be pasted, but doesn't solve anything.

Thanks for your help.

TinyMCE 4.5.1
Internet Explorer 11.0

@fyrkant
Copy link

fyrkant commented Feb 20, 2017

Hi! Can you reproduce the issue in a fiddle to make it easier for us to understand the problem?

@infosaurus
Copy link
Author

infosaurus commented Feb 20, 2017

Hi fyrkant,

I reproduced the issue in fiddle.tinymce.com by just inserting the code from my first message and copy pasting in the inline editor a h1 from any web page, say a Wikipedia article for instance.

http://fiddle.tinymce.com/VJfaab on IE11

Repeating the code here, just for reference :

<script type="text/javascript">
        tinymce.init({
            selector: '.editable-simple',
            inline: true,
            toolbar: 'undo redo',
            menubar: false,
            plugins: "paste",
            paste_as_text: true
        });
</script>

<h2 class="editable-simple mce-content-body" id="title" style="position: relative;" contenteditable="true" spellcheck="false" data-postback="Title"></h2>

image

@infosaurus
Copy link
Author

Anyone? Extra stuff needed besides the fiddle?

Thanks

@infosaurus
Copy link
Author

Anyone have any idea why this is still in "needs more info"?

Please let me know if extra details are needed , thanks.

nadirayasmeen pushed a commit to hannonhill/tinymce that referenced this issue May 15, 2019
If the external_only option is specified, don't show the source type or link type in the image & link plugins
nadirayasmeen pushed a commit to hannonhill/tinymce that referenced this issue May 16, 2019
…e type is external tinymce#3497

Since removing the source type for the "external only" option, added a check to populate the external source/href when it's empty, since the source type defaults to internal without the "external only" option
@metricjs
Copy link
Contributor

metricjs commented May 5, 2020

Hi,
I'm unable to reproduce this issue in TinyMCE 4.9.10 and 5.2.2 using the details provided, however looking back at the changelog it appears this issue was fixed in TinyMCE 4.7.12. As such I'm going to close this, however if you're still experiencing issues then let us know and we'll reopen this issue.
Thanks!

@metricjs metricjs closed this as completed May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants