#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...
- Copy richtext from GMail that has been bolded or underlined.
- Paste it into FCKeditor
- 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 Changed 18 years ago by
Keywords: | Confirmed added |
---|
comment:2 Changed 17 years ago by
Milestone: | → FCKeditor 2.5 |
---|---|
Version: | → FCKeditor 2.4.2 |
comment:3 Changed 17 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
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
I am interested in following that post if something new happens (and thanks for the trick !)
Replying to dustball:
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:
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).
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.