wysihtml5 Dissable Parser Rules when pasting but enable for prepoluted text and typing? -


using wysihtml5 editor, there way disable parser rules pasting, or paste plain text? such plain text, no tags or other formatting pasted? commenting out parser rule not work me because still want pre-populated text (with anchor , line-break tags) parsed parser rules. although not essential, editor detect urls , create anchors type, not when pasting.

the reason want because lot of garbage characters (like new lines %0a , span tags) pasted when pasting using parser rules (specially msword, web content). pasting plain text prevent random hidden content being pasted.

just reference, parser rules extremely simple:

var wysihtml5parserrules = {   tags: {     br:     {},     a:      {       set_attributes: {         target: "_blank",         rel:    "nofollow"       },       check_attributes: {         href:   "url" // important avoid xss       }     }   } }; 

if want plain text time, go project scripts , find file wysihtml5-toolbar.min.js

find text

wysihtml5.dom.getpastedhtml=function(a){var b;return a.clipboarddata&&(wysihtml5.lang.array(a.clipboarddata.types).contains("text/html")?b=a.clipboarddata.getdata("text/html"):wysihtml5.lang...

change b=a.clipboarddata.getdata("text/html") "text/plain"

share|improve answer

your answer

 
discard

posting answer, agree privacy policy , terms of service.

not answer you're looking for? browse other questions tagged or ask own question.

Comments