[horde] IMP: HTML editor - paste from word / Office /webpage doesn't work
Frank Richter
frank.richter at hrz.tu-chemnitz.de
Mon Jun 24 13:13:52 UTC 2013
Quoting Michael M Slusarz:
>
>> The problem here: As it worked in IMP4, our users complain ...
>
> And the problem here is that IMP 4 had GIANT holes that people could use
> to completely ignore any sort of compose message limitations. That is
> much more important.
I understand the security issues. So the main goal is to eliminate all HTML
tags when pasting formatted text, right?
As I understand it this is currently done in
imp/js/ckeditor/pasteattachment.js calling stripTags()
ev.data.html = ev.data.html.stripTags();
So e.g. '<p>Text 1</p><p>Text 2</p>' becomes 'Text1Text 2'
This is ugly, as removing the whitespaces / line breaks disturbs reading.
I tried CKEditor's option forcePasteAsPlainText set to true:
http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.forcePasteAsPlainText
'CKEDITOR.config.forcePasteAsPlainText = true;' in
imp/lib/Script/Package/ComposeBase.php
(patch attached)
Effect: Pasting '<p>Text 1</p><p>Text 2</p>' becomes 'Text1<br />Text
2' -> better reading.
Dropping of images in CKEditor still works (which is very cool indeed!).
Then the 2 buttons in the toolbar - "Copy" and "Copy from Word" - could be
removed, as they won't work as expected.
Thanks,
Frank
--
Frank RICHTER
CHEMNITZ UNIVERSITY OF TECHNOLOGY
-------------- next part --------------
A non-text attachment was scrubbed...
Name: h5-patch-imp-paste-text.diff
Type: text/x-patch
Size: 624 bytes
Desc: not available
URL: <http://lists.horde.org/archives/horde/attachments/20130624/24a22080/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: frank_richter.vcf
Type: text/x-vcard
Size: 194 bytes
Desc: not available
URL: <http://lists.horde.org/archives/horde/attachments/20130624/24a22080/attachment-0001.vcf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5155 bytes
Desc: S/MIME Kryptografische Unterschrift
URL: <http://lists.horde.org/archives/horde/attachments/20130624/24a22080/attachment-0003.bin>
More information about the horde
mailing list