Opened 15 years ago

Last modified 15 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

  1. Using "Replace Textarea by code" example, fill editor with content:
    <h1></h1>
    
  2. Evaluate this code:
    var e = CKEDITOR.instances.editor1;
    var text = e.document.getBody().getChild( 0 ).getText();
    console.log(typeof text);
    CKEDITOR.tools.trim(text);
    
  3. Results in "TypeError: str is undefined" from CKEDITOR.tools.trim

Please correct me if my point of view is incorrect.

Change History (1)

Changed 15 years ago by Tobiasz Cudnik

Attachment: 3487.patch added
Note: See TracTickets for help on using tickets.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy