Rails 3.1 CKEditor gem raw text

I use the ckeditor bug, and when I use paste as a text dialog, it encapsulates the text in quotation marks, as well as <p> and <br>. Is there a way I can tell ckeditor not to use any markup when using this option.

What I'm trying to accomplish is to have snippets of code inside an article. These fragments are processed using markdown gemstone as well as .rb pigments. The following code is what I'm trying to execute

```ruby puts "hello world" class Hello end ``` 

and this is what I get

 <p> ```ruby<br /> &nbsp; puts &quot;hello world&quot; &nbsp; class hello<br /> &nbsp; end<br /></p> 
+4
source share
4 answers

This may be what you are looking for:

http://ckeditor.com/addon/codemirror

+1
source

I really don't know if ckeditor has this parameter.

If your problem shows information such as WYSIWYG on a network with RoR, you may need to establish in the view that the html information is safe (this is for security reasons and is set by default). If you do not, you will see html tags.

You have many ways to make an html safe:

It discusses which one to use: raw vs. html_safe vs h for unescape html

Hope to solve your problem.

+1
source

Codemirror may be your best bet for this. This is similar to CKeditor, but for code.

http://codemirror.net/

You can even write your own mode for it, which, if I understand what you're trying to do, may be necessary.

0
source

Didn't find anything better than going with Markdown. Just as done here on SO

0
source

All Articles