Opened 4 years ago

Closed 4 years ago

Last modified 4 years ago

#14287 closed Bug (invalid)

Paste As Plain Text doesn't work as expected

Reported by: Sergei Owned by:
Priority: Normal Milestone:
Component: Core : Pasting Version: 4.3.1
Keywords: Cc:

Description

Steps to reproduce:

1) open https://www.google.by/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=text

2) copy the first found result

3) Paste As Plan text

Expected result

Text - Wikipedia, the free encyclopedia<br />
https://en.wikipedia.org/wiki/Text<br />
Text may refer to: ... can be "read"; Textbook, a book of instruction in any branch of study; Religious text, a writing that a religious tradition considers to be sacred ...<br />
‎Text (literary theory) - ‎Plain text - ‎Text &amp; Talk - ‎Text messaging

Actual result

<p unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">Text - Wikipedia, the free encyclopedia<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
https://en.wikipedia.org/wiki/Text<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
</br></br></br></br>&nbsp;</p>

<p unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}"><br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
Text&nbsp;may refer to: ... can be "read"; Textbook, a book of instruction in any branch of study; Religious&nbsp;text, a writing that a religious tradition considers to be sacred&nbsp;...<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
‎Text (literary theory)&nbsp;-&nbsp;‎Plain text&nbsp;-&nbsp;‎Text &amp; Talk&nbsp;-&nbsp;‎Text messaging<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
<br unique="function () {
    var a = this.concat();
    for (var i = 0; i &lt; a.length; ++i) {
        for (var j = i + 1; j &lt; a.length; ++j) {
            if (a[i] === a[j])
                a.splice(j--, 1);
        }
    }

    return a;
}">
</br></br></br></br></br></br></br></br>&nbsp;</p>

Additional information:

ckeditor version 4.3.1, allowedContent : true

Change History (5)

comment:1 Changed 4 years ago by Jakub Ś

Keywords: paste plain removed
Resolution: invalid
Status: newclosed

First of all, you should not use allowedContent:true but rather configure ACF so that it allows tags you need. You can use extraAllowedContent for that.

Second - I could not reproduce that problem. I have tried Chrome, FF and IE11 with CKEditor 4.5.6 and 4.3.1 (full packages). In both cases only the expected result was pasted.


From your description it looked like it is enough to paste the text but that is not the case. Because of that I'm closing the issue as invalid.

Please upgrade your editor and retry. If you can still reproduce this problem, please provide more details and I will reopen the ticket once I'm able to reproduce it myself.

comment:3 Changed 4 years ago by Jakub Ś

I'm sorry but currently I can't confirm the problem.

Ok, I can reproduce it under provided link but: this is still version 4.3.1, it uses many third-party plugins (one of them might be responsible for this problem) and it has custom code modifications (Ctrl+V pastes text and shows Paste as Plain Text dialog what doesn't happen in default editor). Currently this looks like an implementation issue to me.

If the ticket is to be reopened, you need to provide steps to reproduce this problem in default standalone CKEditor (default package put into your server and outside of your application).

comment:4 Changed 4 years ago by Sergei

thx

comment:5 Changed 4 years ago by Jakub Ś

and it has custom code modifications (Ctrl+V pastes text and shows Paste as Plain Text dialog what doesn't happen in default editor).

That is not a core code modification. You could have added a listener which shows the dialog. Sorry for that. If you have changed any CKEditor internals try doing the same as for the third-party plugins.

Try disabling all the custom plugins, clear browser's cache (this is not Ctrl+F5 which is cache refresh) and start enabling them one by one repeating your test case. Once you get the error you will know what caused it.
You can also start with default CKEditor package and start adding your changes/plugins there.


Another possibility might be some third party script used in your application. You can do the same round of checking as for the plugins/core code changes.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy