代码着色怎么无法显示html?

2012 年 12 月 30 日
 kenneth
http://www.mvmap.com/code/2
想写一个简单的代码分享服务,但是代码着色无法显示html,不知道错哪里?
用的是google-code-prettify库
2912 次点击
所在节点    程序员
7 条回复
bindiry
2012 年 12 月 30 日
难道需要把 ">" 转成 "&gt;", "<" 转成 "&lt;" ?
bindiry
2012 年 12 月 30 日
难道需要把 ">" 转成 "&gt ;", "<" 转成 "&lt ;" ?
bindiry
2012 年 12 月 30 日
kenneth
2012 年 12 月 30 日
@bindiry 确实用pre标签,但是不知道是不是给转义了,就是一部分html代码没了
kenneth
2012 年 12 月 30 日
@bindiry 我看了下@SErHo的http://tocode.sinaapp.com代码,需要用xhtml_escape转义一下。现在OK了
qiayue
2012 年 12 月 31 日
或者,你可以换一个插件,用SyntaxHighlighter,简单易用
http://alexgorbatchev.com/SyntaxHighlighter/

code4app 用的就是这个插件 http://code4app.com/snippets/one/iphone-swipe-left-and-right/50d54f106803fa7174000000#s0
bindiry
2012 年 12 月 31 日
@kenneth 原来如此,学习了。:)

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/56238

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX