I’m using CKEditor in a CMS I’ve built. I want use the ability to drag links into the WYSIWYG window.
The links in question, (which are generated in a div outside the editor that pops up in response to a mouse-click) have “root-relative” urls in their src attributes — e.g. /article/23420/this-is-my-article.html
When I drag this into the editor, however, the protocol and domain-name are prepended to the url in the src attribute for the inserted link HTML. So the example above, when inserted, looks like this: http://localhost:22565/article/23420/this-is-my-article.html
I do not want to prepend the production-site domain name to the src in the pop-up div because the CMS is hosted at a separate domain from the production site, and we need the links to be able to work within the CMS as well as in the production site.
QUESTION: Is there a way to prevent CKEditor from prepending the protocol and domain-name to the link src?
It’s not CKEditor doing this, but browsers. The same result I have for simple editable div created without CKEditor. Unfortunately, without custom drag&drop support it won’t possible to handle that properly. I’m not even sure if d&d support will help, because if browser provides only non-relative URL, then there’s no option to strip it later.