Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
in Plugins by
Is there any editor plugin to support insert code in question content?

2 Answers

+2 votes
selected by
Best answer

The default editor will let you insert a code using the Formatted (click on Normal dropdown) option, i.e.

var cow = new Mammal( "moo", {
	legs: 4
} );

Or you can also adjust the editor to include this plugin: https://ckeditor.com/cke4/addon/codesnippet

I got it

Thanks very much
0 votes

With the Markdown editor you can format text as code by indenting it with 4 spaces. Alternatively you can also put text in <pre> tags to have it rendered as a code block.

This would be rendered as regular text.

    This would be rendered as code.

This would also be rendered as code.