Search code examples
c#prettify

Prettify stripping Generics from C# code block


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?


Solution

  • 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)