[Product-Developers] dexterity: transform HTML before saving

Kees Hink keeshink at gmail.com
Thu Sep 27 07:57:40 UTC 2012


FWIW, i filed https://dev.plone.org/ticket/13199

On 09/27/2012 07:37 AM, David Glick (Plone) wrote:
> 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