#7371 closed Bug (fixed)
Setting CKEDITOR.config.pasteFromWordRemoveFontStyles to false throws an exception when pasting from word
Reported by: | Michael Camden | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | Plugin : Paste from Word | Version: | 3.5.2 |
Keywords: | HasPatch | Cc: | satya_minnekanti@… |
Description
TypeError: Cannot call method 'match' of null
File: pastefromword/filters/default.js
Ln 1121:
Parent Method: CKEDITOR.cleanWord calling dataProcessor.toHtml
I've traced the error to the following call stack:
Ln 897: calling stylesFilter with an array, which later calls styleMigrateFilter
Ln 546: styleMigrateFilter attempts to create a CKEDITOR.htmlParser.element object with the null parameter. Since the element doesn't have a tagName, .match is called on null (core/htmlparser/element.js ln: 40) which throws an exception.
Tested on Firefox 3, and Chrome.
I've attached the example document that I was using to test pasting.
Attachments (1)
Change History (8)
Changed 14 years ago by
Attachment: | BugReport_Example.docx added |
---|
comment:1 Changed 14 years ago by
Suggested fix:
File: pastefromword/filters/default.js
Ln 552:
Replace, var styleElement = new CKEDITOR.htmlParser.element( null ),
With, var styleElement = new CKEDITOR.htmlParser.element( 'span' ),
comment:2 Changed 14 years ago by
Keywords: | pastefromword exception thrown pasting removed |
---|
comment:3 Changed 14 years ago by
Cc: | satya_minnekanti@… added |
---|
comment:4 Changed 14 years ago by
Keywords: | HasPatch added |
---|
comment:5 Changed 14 years ago by
Status: | new → confirmed |
---|
Confirmed in 3.5.2, to reproduce this issue make sure to set in config.js
config.pasteFromWordRemoveFontStyles = false;
and comment out the try/catch statement around line 1127 in pastefromword/filters/default.js, because otherwise an alert message is displayed.
@mrfr0g - are you still able to reproduce this issue using the Nightly Build?
comment:6 Changed 14 years ago by
Resolution: | → fixed |
---|---|
Status: | confirmed → closed |
The nightly build appears to fix the problem.
comment:7 Changed 11 years ago by
Component: | Core : Pasting → Plugin : Paste from Word |
---|
Example I used to test