I have a problem in IE7 and IE8. I have always activated paste as plain text, so anyone can get unwanted malicious links. The problem is that if I write a text with a url, it automatically detects and converts the url into a link, when it should be plain text, for example, write this:
"This is a test with a link to the website of CKEditor, www.ckeditor.com. If I keep typing the url is active as a link."
That url is activated and becomes binding. How could I turn off this transformation?
Tue, 04/12/2011 - 13:41
#1
Re: Plain text and not detect url
Re: Plain text and not detect url
Re: Plain text and not detect url
Re: Plain text and not detect url
As I said in the first post, I have selected the option to paste plain text.
I have it just like you comments, with this code:
The problem is still not working.
Re: Plain text and not detect url
That's strange, it should fix your problem - I did test it before I posted my answer, and I saw that you said you had it activated as plain text, I though you mght have been using the interface buttons rather than down at the javascript config.
Have you tried pasting your test text into the demo using the paste/paste as text/ CTRL+V? I tried with your text and the behaviour is correct, try it just in case you have some sort of weird browser setting on plugin interfering with it. Its unlikely, but lowest common denominator and all that.
It might be a problem with your config file, maybe another option is overridding .forcePasteAsPlainText?
Re: Plain text and not detect url
But with IE, even in the demo, I get the link. Occurs in several ways:
1 .- Hand Writing url and pressing SPACE, detects that it is a url
2 .- CTRL + V is written as a url.
3 .- button "Paste as Plain Text" writes plain, but pressing SPACE makes URL
These cases are in IE, both the demo and in my project.
Re: Plain text and not detect url
Re: Plain text and not detect url
Re: Plain text and not detect url
Maybe something so simple as using a keyboard listener that checks after a few milliseconds if now the caret is after a link might work. I don't know, you'll have to test, try, ... I'm not sure if you could use some kind of DOM mutation events, but they are generally too expensive (= slow page).
It would be cool if you find a nice solution, because it's not that hard to create a little bit of nasty code that performs the job (for example checking the number of links before and after each keystroke) but that slows the page to a crawl.
Re: Plain text and not detect url
As a temporary workaround (until someone find a better solution) you can include a note that all links will be saved as plain text and then strip all <a> tags on the server side.
This way you'll be also guarded against some other hacks that can be performed on the client side in order to include links.
Re: Plain text and not detect url
Below I propose an idea which can be further developed and improved (e.g. in order to increase performance we could probably operate directly on DOM nodes, bypassing CKEditor's classes)
The eraseLinks() function should be also invoked just before submitting a form.
Re: Plain text and not detect url
Re: Plain text and not detect url
Re: Plain text and not detect url
Re: Plain text and not detect url
Yes, of course you're right but I believe it was exacty the original poster's intention.
I'm also afraid that in case of pasting text we won't be able to say if the new link is automatic or not.
E.g. could we differentiate between pasting
(plain text)
and
(explicit link copied e.g. from other part of the same document)
?