[Product-Developers] dexterity: transform HTML before saving

David Glick (Plone) david.glick at plone.org
Thu Sep 27 05:37:52 UTC 2012


On 9/26/12 5:16 AM, Kees Hink wrote:
> These answers were very helpful, thanks.
>
> In our richtexteditor.js, we now added this setup parameter:
>
>     params = $.extend(
>       {
>         // ...
>         setup : function(ed) {
>            ed.onSaveContent.add(function(ed, o) {
>                // find all img's with src=data:image
>                var pattern=/\<img[^>]*src=[^>]*data:image[^>]*\/\>/g;
>                var filtered=o.content.replace(pattern, '');
>                o.content=filtered;
>            });
>         },
>     // ...
>       },
>
> That's all we need for now to prevent normal users doing this.
>
Any reason we shouldn't add this to Products.TinyMCE?
David



More information about the Product-Developers mailing list