问题描述
我的博客托管在Blogger上,我经常在 C / C# / <$ c $中发布代码片段c> Java / XML 等等,但是我发现这个代码片断mangled。
<是否有任何网站可以用来事先分析代码片段并对格式进行排序,将XML< 转换为& amp ; lt; etc。
这个地区有很多问题,但是我找不到这个问题直接。
编辑: 2.0添加代码语法突出显示给博客
这是我的博客文章:
$ b
我希望它能帮助你们..我对它能做什么印象深刻。
My blog is hosted on Blogger and I frequently post code snippets in C / C# / Java / XML etc. but I find the snippet gets "mangled".
Are there any web sites that I could use to parse the snippet beforehand and sort out the formatting, convert XML "<" to "<" etc.
There are a numbers of questions around this area on SO but I couldn't find any that address this question directly.
Edit: For @Rich answer, site states "To display the formatted code on your site, you need to get this CSS stylesheet, and add a reference to it in the <head> section of your page". That's the problem - you can't do this on Blogger AFAIK.
I've created a blog post entry which explains how to add code syntax highlighting to blogger using the syntaxhighlighter 2.0
Here's my blog post:
http://www.craftyfella.com/2010/01/syntax-highlighting-with-blogger-engine.html
I hope it helps you guys.. I'm quite impressed with what it can do.
这篇关于格式化Blogger上的博客代码片段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!