Project

General

Profile

Actions

Bug #31579

closed

Copied MS Word content becomes broken after saving and opening text content element

Added by Juris Treibahs over 12 years ago. Updated about 12 years ago.

Status:
Closed
Priority:
Must have
Category:
RTE (rtehtmlarea + ckeditor)
Target version:
Start date:
2011-11-04
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.5
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

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

test_table.doc (25 KB) test_table.doc Juris Treibahs, 2011-11-04 13:51
htmlarea.patch (642 Bytes) htmlarea.patch Juris Treibahs, 2011-11-04 13:51

Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Bug #32263: HTML entity &nbsp; is inserted before and after HTML TagsClosedStanislas Rolland2011-12-02

Actions
Actions #1

Updated by Juris Treibahs over 12 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">&nbsp;<tbody><tr>&nbsp;<td valign="top" width="295">&nbsp;<p>... HTML has &nbsp; entities in wrong places.

Actions #2

Updated by Chris topher over 12 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
Actions #3

Updated by Matthias Jösting over 12 years ago

Maybe this ist related to / a duplicate of #32263.

Actions #4

Updated by Stanislas Rolland about 12 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
Actions

Also available in: Atom PDF