Opened 9 years ago
Closed 9 years ago
#14341 closed Bug (wontfix)
TypeError in InsertText with MS Word Tags
Reported by: | Andreas Soroko | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Steps to reproduce
- Create editor
- execute
CKEDITOR.instances.editor.setData('<html><head></head><body><o:p><FONT face=Calibri> </FONT></o:p></body></html>') - click in the font tag ( <FONT face=Calibri>| </FONT> )
- then CKEDITOR.instances.editor.insertText('hi')
Expected result
text 'hi' has been inserted
<o:p>
<FONT face=Calibri>hi</FONT>
</o:p>
Actual result
- TypeError: w is undefined
- two font tags created
<o:p>
<FONT face=Calibri></FONT>
<FONT face=Calibri></FONT>
</o:p>
Other details (browser, OS, CKEditor version, installed plugins)
- Browser : Xulrunner/Gecko 29 - Firefox 43
- OS : Windows 7,8,10
- CKEDITOR : 4.5.2 / 4.5.6
Attachments (2)
Change History (5)
Changed 9 years ago by
Attachment: | build-config.js added |
---|
Changed 9 years ago by
comment:1 Changed 9 years ago by
Keywords: | inserttext o:p word typeerror removed |
---|---|
Status: | new → pending |
Version: | 4.5.6 |
I have been able to reproduce this issue with allowedContent : true
only.
Ok, there is an error thrown but this example is very non-standard to say the least. Why did you turn off ACF and why are you using non-html tags inside HTML editor? Is there any real-life use case behind this?
I know <o:p>
tags are MS Word tags but they are removed by ACF and paste from word filter. At the moment it just looks like you have troubled yourself to create configuration so bad that it results in error when performing non-standard action.
comment:2 Changed 9 years ago by
We use the editor to create and display emails ( also external ) , with allowContent : false
, the email will be modified and the view does not resemble the original mail in many cases
comment:3 Changed 9 years ago by
Resolution: | → wontfix |
---|---|
Status: | pending → closed |
I have discussed this issue with my colleagues and we have to consider it a "won't fix" issue.
First of all CKEditor is HTML and not XML editor. Second is that there might be 1000 other cases like that one. ACF
and pastefromword
filter prevent that from happening.
I personally think it would be much better if you turn on ACF and extend it accordingly to your needs so that it allows entering a predefined set of tags, attributes, styles and perhaps classes.
Some parts of pasted content may be changed, especially if they are created with some weak tools which don't follow HTML specification. You can however control what gets removed by defining what is allowed. Users will also have ability to fix their content using CKEditor features and such email should be displayed properly in email client.
I personally think this is much better than allowing your users to paste every junk HTML there is. With such "HTML", emails may not look as intended in email client.
To learn more about ACF please see:
http://docs.ckeditor.com/#!/guide/dev_acf
http://docs.ckeditor.com/#!/guide/dev_advanced_content_filter
http://docs.ckeditor.com/#!/guide/dev_disallowed_content
http://docs.ckeditor.com/#!/api/CKEDITOR.filter-method-addTransformations
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-allowedContent
http://docs.ckeditor.com/#!/api/CKEDITOR.config-cfg-extraAllowedContent
minimal config