* Fixes issues with pasted html.
*/
event.editor.on('paste', function(ev) {
- console.debug("currentValue = " + ev.data.dataValue);
if (ev.data.type == 'html') {
var $value = ev.data.dataValue;
// convert lists into new lines
$value = $value.replace(/<\/li>/gi, "\n");
- console.debug($value);
// remove html tags
$value = $value.replace(/<[^>]+>/g, '');
// fix multiple new lines
$value = $value.replace(/\n{3,}/gi,"\n\n");
- window.dtdesign = $value;
-
ev.data.dataValue = $value;
$pasted = true;
* Converts html to bbcodes.
*/
var toDataFormat = function(html, fixForBody) {
- console.debug("toDataFormat");
if (html == '<br>' || html == '<p><br></p>') {
return "";
}
html = html.replace(/%20/g, ' ');
return html;
- }
+ };
})();