Opened 16 years ago
Last modified 16 years ago
#3487 closed Bug
getText() not always returns string — at Initial Version
Reported by: | Tobiasz Cudnik | Owned by: | Tobiasz Cudnik |
---|---|---|---|
Priority: | Normal | Milestone: | CKEditor 3.0 |
Component: | General | Version: | SVN (CKEditor) - OLD |
Keywords: | Confirmed Review+ | Cc: |
Description
For empty nodes, getText() will return undefined instead of empty string. According to jsdoc, this method returns string.
Sample testcase
- Using "Replace Textarea by code" example, fill editor with content:
<h1></h1>
- Evaluate this code:
var e = CKEDITOR.instances.editor1; var text = e.document.getBody().getChild( 0 ).getText(); console.log(typeof text); CKEDITOR.tools.trim(text);
- Results in "TypeError: str is undefined" from CKEDITOR.tools.trim
Please correct me if my point of view is incorrect.