#33 closed New Feature (fixed)
Improve the Paste from word clean up function
Reported by: | Alfonso Martínez de Lizarrondo | Owned by: | Alfonso Martínez de Lizarrondo |
---|---|---|---|
Priority: | Normal | Milestone: | FCKeditor 2.4 |
Component: | Plugin : Paste from Word | Version: | |
Keywords: | Cc: |
Description
Check the changes proposed in
https://sourceforge.net/tracker/index.php?func=detail&aid=1443472&group_id=75348&atid=543655
and http://wiki.fckeditor.net/ImprovingPasteFromWord
then try to define a clean up code that we can agree on and also provide an easy way for the developer to add their own clean up code if he doesn't like the function.
Change History (12)
comment:1 follow-up: 2 Changed 18 years ago by
Status: | new → assigned |
---|
comment:2 follow-up: 3 Changed 18 years ago by
Replying to alfonsoml:
I've moved the code to FCKTools so it's possible from a plugin to easily change that code if a developer feels that he needs other code.
The main reason of not having the code in FCKTools, is just because it will make the final code bigger (2KB compressed) for something that is not used by the main interface. It is actually used in a specific dialog, giving us the possibility of making that load only when that popup is loaded.
I would suggest to leave the default code in the dialog. To make is easily extensible, we can check in the dialog for the presence of the FCK.CustomCleanWord function. Then we document that the word cleanup function can be replaced by defining FCK.CustomCleanWord in a plugin.
Besides that, I've added a configuration setting FCKConfig.CleanWordKeepsStructure (default false to keep the old behavior) so that for all the people that wants to keep the basic HTML clean instead of the mess that it's generated right now can change the behavior without the need to use a custom plugin.
Ok for now. Maybe we gonna change this for the 3.0.
I think that indeed the default for the new option should be to keep the HTML, I don't understand why anyone would really want to change the <h1> to <div><b><font size="6">
The current Word cleanup has been a sponsored development. They wanted to have the output as much as closer as the original word. So, things like <h1> to <div><b><font size="6"> came up.
I don't like it too, and I strongly believe we'll be completely reviewing this feature. Actually, it seams that this one is one of the most important one.
comment:3 Changed 18 years ago by
Replying to FredCK:
The main reason of not having the code in FCKTools, is just because it will make the final code bigger (2KB compressed) for something that is not used by the main interface. It is actually used in a specific dialog, giving us the possibility of making that load only when that popup is loaded.
I would suggest to leave the default code in the dialog. To make is easily extensible, we can check in the dialog for the presence of the FCK.CustomCleanWord function. Then we document that the word cleanup function can be replaced by defining FCK.CustomCleanWord in a plugin.
Ok, I've changed it that way, it's just as easy for any developer and keeps the main code base clean.
I think that indeed the default for the new option should be to keep the HTML, I don't understand why anyone would really want to change the <h1> to <div><b><font size="6">
The current Word cleanup has been a sponsored development. They wanted to have the output as much as closer as the original word. So, things like <h1> to <div><b><font size="6"> came up.
The fact is that too many people doesn't understand that logic as it's quite easy to get the same effect using css and the output html will be easier to handle. With these changes everybody should be happy.
comment:5 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
merged in revision 65
comment:6 Changed 18 years ago by
I've added the description of the configuration setting and the ability to use a custom function in http://wiki.fckeditor.net/Developer%27s_Guide/Configuration/Configurations_Settings
comment:7 Changed 18 years ago by
Milestone: | → FCKeditor 2.4 |
---|---|
Resolution: | fixed |
Status: | closed → reopened |
Hi Alfonso... it seams that the CleanWordKeepStructure configuration is not used in any place in the code:
https://sourceforge.net/forum/message.php?msg_id=4119659
Maybe it got lost when moving the code from the core files to the Paste dialog.
Do you think you can check it?
comment:8 Changed 18 years ago by
Sorry... it was a type in the code.... an extra "s" was added in the code, resulting in CleanWordKeepsStructure. I'm fixing it.
comment:9 Changed 18 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
comment:10 Changed 18 years ago by
Ops, too many things in my head. Although I would rather have fixed the config file so the name looks like a proper English sentence: Clean Word Keeps Structure I can bet that sometime in the future some purist will file a bug to fix the typo :-)
comment:11 Changed 18 years ago by
Well... I'm a kind a purist I think... I'm so tempted to put that "s" back again! I'll do it!
comment:12 Changed 11 years ago by
Component: | General → Plugin : Paste from Word |
---|
I've added the code to my branch.
I've moved the code to FCKTools so it's possible from a plugin to easily change that code if a developer feels that he needs other code.
Besides that, I've added a configuration setting FCKConfig.CleanWordKeepsStructure (default false to keep the old behavior) so that for all the people that wants to keep the basic HTML clean instead of the mess that it's generated right now can change the behavior without the need to use a custom plugin.
I think that indeed the default for the new option should be to keep the HTML, I don't understand why anyone would really want to change the <h1> to <div><b><font size="6">