From: Honza M. <hon...@ec...> - 2003-05-20 16:04:00
|
I hope You already tested the code, because I currently can't test it on Linux machine. As I looked at the code you remove ALL <font>, <p>, <span> and <o:p> tags, so I hope it is what you want from this function. Now it is in CVS. Honza On =DAt, 2003-05-20 at 09:41, Norbert Brazda wrote: > I have modified /apc-aa/misc/wysiwyg/richedt_ie.js script to remove not o= nly <font> tags, but also remove other garbage added when you copy text fro= m MS Word into Rich Text Area editor. Could someone add this change this in= to CVS? >=20 > Word often add tags which change your defaul layout: > <p class=3D"MsoNormal" style=3D"border: medium none; padding: 1cm"> >=20 >=20 > Here is the function: >=20 > 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); > } > } >=20 >=20 >=20 > ------------------------------------------------------- > This SF.net email is sponsored by: ObjectStore. > If flattening out C++ or Java code to make your application fit in a > relational database is painful, don't do it! Check out ObjectStore. > Now part of Progress Software. http://www.objectstore.net/sourceforge > _______________________________________________ > Apc-aa-coders mailing list > Apc...@li... > https://lists.sourceforge.net/lists/listinfo/apc-aa-coders >=20 |