From: Norbert B. <br...@ch...> - 2003-05-20 07:41:43
|
I have modified /apc-aa/misc/wysiwyg/richedt_ie.js script to remove not = only <font> tags, but also remove other garbage added when you copy text = from MS Word into Rich Text Area editor. Could someone add this change = this into CVS? Word often add tags which change your defaul layout: <p class=3D"MsoNormal" style=3D"border: medium none; padding: 1cm"> Here is the function: function clearfonts(nom_editor) { var text =3D get_text (nom_editor); if (confirm ("Are you sure you want to remove formating html = tags?")) { text =3D text.replace (/<[Ff][Oo][Nn][Tt][^>]*>/g,""); text =3D text.replace (/<\/[Ff][Oo][Nn][Tt]>/g,""); // added lines start: text =3D text.replace (/<[Ss][Pp][Aa][Nn][^>]*>/g,""); text =3D text.replace (/<\/[Ss][Pp][Aa][Nn]>/g,""); text =3D text.replace (/<[Pp][^>]*>/g,"<p>"); text =3D text.replace (/<[Oo]:[Pp][^>]*>/g,""); text =3D text.replace (/<\/[Oo]:[Pp]>/g,""); // added lines end. posa_contingut_html (nom_editor,text); } } |