Bug #31579
closedCopied MS Word content becomes broken after saving and opening text content element
0%
Description
Copy content from MS Word file that has a table (example file is attached), execute "Remove MS Word format" click "Toggle text mode" once. You can see HTML
<table border="1" cellpadding="0" cellspacing="0"> <tbody><tr> <td valign="top" width="295"> <p>...
After clicking "Toggle text mode" and returning to wysiwyg mode table border looks wide, text in table cells has extra spaces before and after it. When clicking "Toggle text mode" again, HTML code look such way -
<table border="1" cellpadding="0" cellspacing="0"> <tbody><tr> <td valign="top" width="295"> <p>... HTML is fine.
You can get such broken HTML also copying content from MS Word and saving changes. Next time record is opened for editing (also after clicking "Save document" which renders record immediately after saving) the table in wysiwyg mode looks broken.
When htmlarea converts copied content from MS Word to HTML it creates whitespaces between HTML tags. At rendering in wysiwyg mode (clicking "Toggle text mode" twice or saving and opening the record) spaces between tags are converted to .
I have solved this problem by removing some lines from typo3/sysext/rtehtmlarea/htmlarea/htmlarea.js file (patch is attached). Htmlarea in typo3 version 4.2.5 did not have those lines of code and did not produce broken HTML in the was described here.
Files
Updated by Juris Treibahs about 13 years ago
I apologize, the first part of description has some mistakes. There is the corrected version of first part -
Copy content from MS Word file that has a table (example file is attached), execute "Remove MS Word format" click "Toggle text mode" once. You can see HTML
<table border="1" cellpadding="0" cellspacing="0"> <tbody><tr> <td valign="top" width="295"> <p>... HTML is fine.
After clicking "Toggle text mode" and returning to wysiwyg mode table border looks wide, text in table cells has extra spaces before and after it. When clicking "Toggle text mode" again, HTML code look such way -
<table border="1" cellpadding="0" cellspacing="0"> <tbody><tr> <td valign="top" width="295"> <p>... HTML has entities in wrong places.
Updated by Chris topher about 13 years ago
- Subject changed from Copied MS Word content becomes proken after saving and opening text content element to Copied MS Word content becomes broken after saving and opening text content element
Updated by Matthias Jösting almost 13 years ago
Maybe this ist related to / a duplicate of #32263.
Updated by Stanislas Rolland almost 13 years ago
- Status changed from New to Closed
- Assignee set to Stanislas Rolland
- Target version set to 4.5.11
- TYPO3 Version changed from 4.6 to 4.5