How does jsfiddle mark up code? Is there a library

2020-07-22 09:09发布

问题:

If you've ever used www.jsfiddle.net, you might notice that it marks up code with proper colorings, and various other helpers like translating tabs to four spaces or shift-tab. With Firebug I see that it's doing this with an iFrame. Is there an open source library to do this? I want to let people write Python on a web page, but make it pretty like jsfiddle.

回答1:

Check out CodeMirror.



回答2:

Look here (SyntaxHighlighter)

Here you can find a simple tutorial.