Project

General

Profile

Actions

Bug #31579

closed

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

Added by Juris Treibahs about 13 years ago. Updated almost 13 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

Also available in: Atom PDF