Opened 8 years ago

Closed 8 years ago

#8212 closed Bug (invalid)

data-scayt_word come automatic

Reported by: rajeshbute Owned by:
Priority: Normal Milestone:
Component: General Version:
Keywords: Cc:

Description

Hello,

I am using the CKEditor 3.x, from last few days i am facing following problem

In ckEditor i made this text $#rajesh and apply the strong tag if i check the view source it will look like this <strong>$#rajesh</strong>

When i hit enter to save in database, it will be save like this <strong><span data-scayt_word="rajesh" data-scaytid="12">$#</span>rajesh</strong>

so when i want to fetch it from database, simply i fire the SELECT query for that field and fetch it. i want to replace the $#rajesh text with another text and because of this <span data-scayt_word="rajesh" data-scaytid="12"> TAG i cant find it.

I also check it in the ckEditor HTML Source, it will be not there, only when it will save in DB at that time it will save like that.

i have posted same on - http://cksource.com/forums/viewtopic.php?f=11&t=23059

i am confused, how this is coming...is any solution?

Change History (8)

comment:1 Changed 8 years ago by Jakub Ś

Status: newpending

I am using the CKEditor 3.x,

Which version exactly are you using?

If you want to get HTML without code produced by SCAYT, you should use getData() method. Please check out basic usage of the api sample and http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#getData.[[BR]] Using some third-party code to get contents directly form the editor is not a good idea because there might be something extra (like in case of SCAYT) that is meant to help CKEditor and is completely useless for the user.

Could you tell me if this is the solution to your problem?

comment:2 Changed 8 years ago by Jakub Ś

@rajeshbute have you got any updates regarding this issue? Did getData solve your problem?

comment:3 in reply to:  2 Changed 8 years ago by rajeshbute

Replying to j.swiderski:

@rajeshbute have you got any updates regarding this issue? Did getData solve your problem?

Thanks, Today/tomorrow i will try for it and if issue is resolve then i will reply back to you.

comment:4 Changed 8 years ago by Jakub Ś

@rajeshbute are there any updates to this issue?

comment:5 in reply to:  4 Changed 8 years ago by rajeshbute

Replying to j.swiderski:

@rajeshbute are there any updates to this issue?

Hi,

i checked this url that you replied - http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#getData

and this code i am trying to use - if ( CKEDITOR.instances.editor1.getData() == )

alert( 'There is no data available' );

but what i need that please check below i am explaining in detail -

  1. i show the CKEditor to user , user place all code there and at last in view source

he place the #rajesh#

  1. now i code it to store it in table - now see in table how it store #<span data-scayt_word="rajesh" data-scaytid="12">rajesh</span>#
  2. now next thing that i just fetch it from table and just show on the plain page, not in the CKEditor so what user inserted #rajesh#

and when i fetch it then it shows me with span tag.

still i am stuck

comment:6 Changed 8 years ago by Jakub Ś

You just fetch with your custom code what CKEditor has inside, but this data should be filtered first and getData() does that.

I understand what you want to do but in my opinion you have missed something between point 1 and 2. Let's say 1.5 it's my proposed solution here.

1.5 - If you are using some custom code to get data from the editor you could, just before fetching the data, invoke getData() on that code or invoke getData(), write the result to some js variable and get clean code from it. If you don’t want to fetch HTMl at all you can use getText method on a particular element - http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#getText.

Does this solution sounds reasonable?

comment:7 in reply to:  6 Changed 8 years ago by rajeshbute

Replying to j.swiderski:

You just fetch with your custom code what CKEditor has inside, but this data should be filtered first and getData() does that.

I understand what you want to do but in my opinion you have missed something between point 1 and 2. Let's say 1.5 it's my proposed solution here.

1.5 - If you are using some custom code to get data from the editor you could, just before fetching the data, invoke getData() on that code or invoke getData(), write the result to some js variable and get clean code from it. If you don’t want to fetch HTMl at all you can use getText method on a particular element - http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.dom.element.html#getText.

Does this solution sounds reasonable?

Hi its resolved - i just disabled the SCAYT plugin and its resolved.

Thanks for the nice forum

and Quick reply.

comment:8 Changed 8 years ago by Jakub Ś

Resolution: invalid
Status: pendingclosed

I will close this ticked as invalid as it was solved without making any patches.

I still think that you can use scayt plugin and get clean data from ckeditor - your control for submitting the post can have js function call which cleans (uses gatData) the code before passing it to server-side part of application.

Note: See TracTickets for help on using tickets.
© 2003 – 2019 CKSource – Frederico Knabben. All rights reserved. | Terms of use | Privacy policy