美化从 C# 代码块中剥离泛型
我在尝试将 Prettify 脚本集成到我的网站中以提供 C# 代码块的智能语法突出显示时遇到了一个小问题。一切工作正常,直到我引入泛型,泛型包含在小于和大于字符中。 Prettify 似乎完全剥离了这些并用单个换行符替换它们。
有人知道如何解决这种令人恼火的行为吗?
I'm having a slight issue with the Prettify script that I'm trying to integrate into my website to provide intelligent syntax highlighting of C# code blocks. All works fine until I introduce Generics, which are contained within less-than and greater-than characters. Prettify seems to be completely stripping these out and replacing them with a single newline character.
Anyone have any idea how to fix this irritating behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
虽然我不知道 Prettify 脚本是做什么的,但它听起来像 <和>迷惑浏览器,因为这些字符用于生成 html 元素。
如果您想要将某些内容呈现为 <和>在html中,你应该写<和> (lt = 小于,gt = 大于)
Though I have no idea what the Prettify script does, it sounds like the < and > confuse the browser, because those characters are used to generate html elements.
If you want something rendered as < and > in html, you should write < and > (lt = less than, gt = greater than)
使用正确的 html 实体来显示 <和>;
<
和>
Use the correct html entities to show < and >;
<
and>