Completed
Last Updated: 03 May 2016 13:26 by ADMIN
ADMIN
Rumen
Created on: 17 Sep 2012 08:18
Category: Editor
Type: Bug Report
0
FIX get_text() client function appends a newline character to the retrieved text in WebKit
The get_text() client side function of the editor seems to append a newline character to the retrieved text. This had the effect of breaking a string comparison I had to clear placeholder text ('enter detailed text here') when the user clicks on the content area. The problem is apparent only on Chrome and Safari, but not IE.

I fixed this problem by removing the trailing newline character using a regular expression:

var t = editor.get_text();
t = t.replace(/\n/g, "")
....then do the string comparison

The problem appeared in version 2012.2 912.
0 comments