[webkit-qt] clean HTML code from clipboard?

brook.hong at nokia.com brook.hong at nokia.com
Thu Jul 14 01:38:17 PDT 2011

Hi all,

Not sure if here is the right place to raise the question.

I have a HTML editor embedded in QWebview, after copy/paste from external web browser like chrome/firefox, the HTML source code is very ugly. Most of them are not necessary, as below,

<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: 'Times New Roman'; font-size: 16px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: collapse; font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 13px; line-height: 12px; text-align: left; ">

How to clean the HTML code before pasting into the editor? Any hints are heavily appreciated.
Best Regards,
Brook Hong

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-qt/attachments/20110714/91e37a60/attachment.html>

More information about the webkit-qt mailing list