Too long to be a comment. I'm not sure that this method will work - depends on how the copy&paste events work. I suggestion that you listen to the "paste" event and during the paste you convert the incoming elements from <xxx> to for example <div class="converted" original="xxx" >. The xxx can be any tag name, such as mytag or iloveponies.
Then when before saving your content you examine the data from CKEditor and convert the elements back to their original statuses. The algorithm might look like this:
- Get data from CKEditor
- Loop through each DIV element from data
- Check if element has the .converted class
- If no, don't do anything to it
- If yes, get the value of it's "original" attribute (xxx)
- Convert the element from DIV back to XXX
- Continue saving your data
You can do that in the fronted or the backend, most likely either will have tools available for this kind of operation. I'm guessing that fronted will be easier though.
<div class="atr converted-mytag"...>. Haven't ever hooked into the copy&paste functionality so not adding as answer (unless it works :D) - Joel Peltonen<XXX>to<div class="convertedTag original-XXX">I'd imagine that hooking into the copy&paste would be a bigger issue. Would that work for you? Is there something I'm not understanding? I'll add an answer if it is possible. - Joel Peltonen