开发者

Prettify stripping Generics from C# code block

开发者 https://www.devze.com 2023-04-03 08:25 出处:网络
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 Generic

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开发者_Python百科 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?


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 &lt; and &gt; (lt = less than, gt = greater than)


Use the correct html entities to show < and >;

&lt; and &gt;

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号