Opened 18 years ago

Closed 17 years ago

Last modified 17 years ago

#217 closed Bug (fixed)

Can't change the formating of text copied from other websites

Reported by: Brian Klug Owned by:
Priority: Normal Milestone: FCKeditor 2.5 Beta
Component: Core : Styles Version: FCKeditor 2.4.2
Keywords: Confirmed Cc:

Description

With any browser...

  1. Copy richtext from GMail that has been bolded or underlined.
  1. Paste it into FCKeditor
  1. Try to unbold or un-underline the text. You can't.

Note: The bug happens with other types of formatting as well.

This happens because GMail uses the style attribute instead of presentational tags like <b> or <u>. More and more websites are using CSS to markup text these days.

This is an important issue because it is very common for people to cut & paste richtext from a webpage into the editor.

Ideally, we'd convert and sanitize all paste operations.

Change History (4)

comment:1 in reply to:  description Changed 18 years ago by Frederico Caldeira Knabben

Keywords: Confirmed added

Replying to dustball:

This happens because GMail uses the style attribute instead of presentational tags like <b> or <u>. More and more websites are using CSS to markup text these days.

Actually GMail doesn't really care about the code it generates. It just uses the standard editing features of each compatible browser (like we also do in many cases).

For example, try it with IE. I had the following output when copying and pasting to FCKeditor:

<p><u>This</u> is a <em>test</em>. Let's <font color="#ff0000">see</font>
some <strong>formatting</strong> here.</p>

And them you will be able to unbold and so on.

The fact is that each browser uses its own standards for formating. You have completely different results with IE, Firefox and Safari (just to add another problem).

Ideally, we'd convert and sanitize all paste operations.

Unfortunately, for security reasons, browsers limit a lot our capacity of "sniffing" the clipboard contents on pasting. Only IE gives us this possibility, spiced with its new security alerts. So probably we'll not be able to handle it in this way.

The only way is to handle the infinity of possible combinations that can be used for formatting, and behave accordingly. In other words, bold can be <b>, <strong> or <span style="font-weight:bold">, while paragraph alignment can be <p align="center"> or <p style="text-align:center">.

There are many performance issues regarding all the necessary checks to be made for every single button in the toolbar (to reflect the caret position state). I really hope that the work for the 2.5, which is getting really hard now, will bring us the perfect solution for it.

comment:2 Changed 17 years ago by Frederico Caldeira Knabben

Milestone: FCKeditor 2.5
Version: FCKeditor 2.4.2

comment:3 Changed 17 years ago by Frederico Caldeira Knabben

Resolution: fixed
Status: newclosed

I've committed [774] today, which introduced the new Style System. It makes it possible to precisely defined on how formatting tags are handled. We can now say that the bold button will generate <b> (or any kind of tag), and will also "override" other tags, like <strong> and <span style="font-weight:bold">. Check out the new entries in the fckconfig.js file.

In the worst case, at least now the "Remove Format" removes any kind of formatting. It is also configurable.

comment:4 Changed 17 years ago by Julia

I am interested in following that post if something new happens (and thanks for the trick !)

Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy