Opened 15 years ago

Closed 15 years ago

#3487 closed Bug (fixed)

getText() not always returns string

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 (last modified by Tobiasz Cudnik)

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:
  2. Evaluate this code:
    var e = CKEDITOR.instances.editor1;
    var text = e.document.getBody().getChild( 0 ).getText();
    console.log(typeof text);;
  3. Results in "TypeError: str is undefined" from

Please correct me if my point of view is incorrect.

Attachments (1)

3487.patch (429 bytes) - added by Tobiasz Cudnik 15 years ago.

Download all attachments as: .zip

Change History (3)

Changed 15 years ago by Tobiasz Cudnik

Attachment: 3487.patch added

comment:1 Changed 15 years ago by Frederico Caldeira Knabben

Keywords: Review+ added; Review? removed
Priority: LowNormal

comment:2 Changed 15 years ago by Tobiasz Cudnik

Description: modified (diff)
Resolution: fixed
Status: newclosed

Fixed with [3469].

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