Creating code snippet with CKeditor
  • 2010/8/31 7:55

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25

I remember in the old FCKeditor was an icon "insert code block" or something. Can anyone use such functions in CKeditor?
So far CKeditor served me very well. But I'm thinking about running something like techblog (many pieces of code to show) and such functionality would be useful.

Of course, I can use the DHTML editor, but it does not produce too structured html. In addition, these [bbcode] is a little dead end, IMHO. I prefer editors to support or full HTML or Markdown markup (easy to read even as plain text).

Re: Creating code snippet with CKeditor
  • 2010/9/2 11:25

  • bumciach

  • Not too shy to talk

  • Posts: 153

  • Since: 2007/6/25

OK. I was looking for a little bit. This topic suggested to me what the problem.

I write posts in CKeditor and would like to show some pice of HTML code. Paste the code in the editor and special characters are converted to HTML Entities automatically. Everything is ok until I open the note for editing: HTML Entities are converted back again to html tags, so it are rendered by the editor.

Preg_replace in the method htmlSpecialChars of MyTextSanitizer class proved to be the culprit. It changes & back to the &. This is useful when using DHTMLeditor or plain text to see the normal texarea tags or quote (instead of HTML Entities). But it spoils the WYSIWYG editors work in some cases.

Are there any work around this?



Lost Password? Register now!

Who's Online

62 user(s) are online (28 user(s) are browsing Support Forums)

Members: 0

Guests: 62



Goal: $100.00
Due Date: Jun 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits