Is there a free code to html syntax highlighter written in C#? [closed]

爷,独闯天下 提交于 2019-12-01 00:42:24

New answer

These days I just use highlightjs which works perfectly well with C#.

Old answer

While I haven't open-sourced it yet, you'd be welcome to the formatter I use for the C# in Depth web site. Give it a try, and let me know if you'd like to use it. (This is no longer available.)

If you can access a command line tool, you can get pygments (it is python), but just pipe the output back into your app.

http://pygments.org/

It's has a multitude of output formats.

I wrote a C# syntax highlighter using regex and a mini "state machine" (a few if statements) here, it could be adapted for C, C++ and Java fairly easily. It produces the inline styles by default and a pre tag.

The source is there in C#.

(Cross pollination answer)

ColorCode-Universal, which used to power syntax highlighting in Codeplex, works pretty well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!