Hello. I have a "Source" button in my editor and I have a trouble when I'm editing the source.
I'm writing something like this:
<a href="[[someHelper:{"jsonvar1":"jsonval1"}]]">someText</a> "[[someHelper]]" - is a magic thing that tells to the server-side script to place something special(no matter what exactly) instead of [[someHelper]] and I expect this [[someHelpe]] will not be changed when I press "Source" button again to look at my text not as sources but as usual view.
But I'm getting broken html instead of this. It becames like this: <a contenteditable="false" span="">[[someHelper...]]</a>.
The question is how I can avoid such an offencide replacement?
Sory for my bad English
First of all - your HTML is
First of all - your HTML is incorrect, bacause you use not encoded `"` character inside href attribute, so breaks it.
Second - I tried this HTML and haven't encountered any issue. Make sure that your HTML is correct and try once again.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
> First of all - your HTML is
> First of all - your HTML is incorrect, bacause you use not encoded `"`
No,no,no :) I see that this HTML is seems as incorrect. But after processing this html at server-side it will became correct. The part between [[ and ]] is only for server-side processing.
I think that the reason of such behavior is exatly incorect HTML ... but this html is incorrect only in editing mode in client-side) After server-side processing before showing this text at the pages of website it becames correct (if it will be saved as is without any processing by ckeditor).
May be there is any way to hint ckeditor to keep some part of text as is and not validate it?
> I tried this HTML and haven't encountered any issue.
May be this depends on config? Wich parametrs may affect?
but this html is incorrect
And that's the problem. Editing require valid HTML.
The HTML you showed is very bad, because your href attribute is destroyed what results in other parsing issues. You could try to encode the content of [[]] as a proper attribute (no "<> allowed) when sending it to editor.
Piotrek (Reinmar) Koszuliński
CKEditor JavaScript Developer
--
CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+