Are there any examples of using the YUI Editor to allow user to submit code snippets etc, like may be used in a bulletin board?. I am talking specifically, about an example that allows a user to apply syntax highlighting to sections of the submitted code, so that it is rendered (for example) as C++, PHP, Python code snippet.
The SO Editor (the one I am currently using to submit this question), has a basic form of syntax highlighting, where you can format a section of the text as code, as demonstrated below开发者_开发百科:
#include <example.hpp>
int main(int argc, char** argv[])
{
// This is a comment
fb = new FooBar();
fb->doSomethingAlready();
delete fb;
}
At the very least, I want to be able to highlight a section of submitted text as code (as I have done above) - USING the YUI Editor.
Better still, I would like to use a full syntax editor that recognizes keywords for a particular language etc. I am sure someone must have written an extension to do this sort of thing before. BUT If any of this is not possible using the YUI editor, maybe someone can suggest an alternative WYSIWYG editor that I may be able to use in place of the YUI editor?
I think this is what you're looking for
精彩评论