Running into an issue with ColdFusion code in ckEditor

Ok I have run into an issue that I am going to say is at ckEditor, as most of you may be aware I wrote an importer for blogCFC.

I am having issues with converting posts from there into ContentBox, especially when looking at a post that has ColdFusion code. No matter what I try the ColdFusion code is never displayed in the editor in ContentBox.

Displays fine on the blog what users will see.

So my question is, as I know nothing when it comes to ckEditor, is there something wrong or something needs to be changed as a configuration option.

I have also found issues when pasting code as well.

Ok I have run into an issue that I am going to say is at ckEditor, as most of you may be aware I wrote an importer for blogCFC.

I am having issues with converting posts from there into ContentBox, especially when looking at a post that has ColdFusion code. No matter what I try the ColdFusion code is never displayed in the editor in ContentBox.

Displays fine on the blog what users will see.

So my question is, as I know nothing when it comes to ckEditor, is there something wrong or something needs to be changed as a configuration option.

I have also found issues when pasting code as well.

Which code?

The code that does the import, or the post that I am trying to import?

Also there seems to be a bug with the default them and some imported posts from blogcfc, changing the theme to one of the others is fine, but the default them every now and then is loosing the style on some imported posts.

Ok its ckeditor

Create a new post and try to type this into the editor

This is a test

<cfoutput>this is something</cfoutput></p>

Now correct me if I am wrong, but the editor should keep what I typed exactly. But it doesn’t.

Ok, If you paste this as is, then it treats it as HTML and not source and coeditor junkyfyess it (yes, that’s a word!!!)

If you go into source mode and paste, it leaves it intact.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yeah but that’s not a solution…

Yea, nothing I can do about it unfortunately, only to mention the workaround, as whatever you paste into it, ck treats as HTML and not source.

An alternative I am contemplating is to have the ability to choose your editor:

ckeditor
plain
code editor (like the widgets)
mediawiki editor
markdown editor

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Actually it didn’t for me.

Pasted this

<cfoutput>this is something</cfoutput></p>

And it stripped the code again.

ahh, i see,

It did this right:

[code] this is something

 

[/code]

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

http://cksource.com/forums/viewtopic.php?t=20486

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yep…

And how do you change the tab intent to 4 instead of 8.

Hmm, not sure Andrew. I am not an expert on ckEditor as well yet, was able to get it up and running really quickly, and extend it rather quickly but it has its quirks thats for sure.

Luis F. Majano
CEO
Ortus Solutions, Corp
www.ortussolutions.com

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Social: twitter.com/lmajano facebook.com/lmajano

Yeah my test to date show it is very funny, and not in a good way either.

Like most other blogs inserting code should be easy, and I like to type the standard . Now if you paste as plain text it will convert it to use the < etc. But not when you just type.

So like you I found ckEditor a breeze to install in other projects, but for editing code it is a right royal pain in the butt.

So what I am trying to establish is a better more generic way of adding code, but one that can also be very easily type or pasted in as well. And so far it isn’t coming across as easy as I thought, the hardest part was converting the code from blogCFC to ContentBox.

I have seen the SyntaxHighlighter widget already on forgebox, but I personally don’t like adding code in that manner, its slow and awkward as well.

Looks like TinyMCE doesn’t have this issue as it converts it to < etc when going to source.

Looks like there are some know workarounds, need to give it a try but there are things like

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.entities

and

http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.basicEntities

So far these nay do the trick, will try as soon as I can.

Ok more tests show that it is when loading the content…

Luis, is there anything special you are doing to the content when loading it?

Ok I have solved this Luis, the HTMLHelper needed to be changed to this

flattenAttributes(arguments,“value,label,wrapper,labelWrapper,bind,bindProperty”,buffer).append(">#htmlEditFormat(arguments.value)#");

Confused. Can you explain what it solves?

Did the config settings work to not change the markup?

No the config options did nothing for editing a post, the problem is that when you type


<cfoutput>#now()#</cfoutput>

And save the post, and re-open it the CF code is not displayed. By doing the htmlEditFormat() it now shows when editing a post.