HTML syntax highlight using Rich-Text Format (RTF)

In case you want to display HTML with highlighted/colored syntax the simplest way to go is use WinForms RichTextBox, all is needed is to add RTF color tags surrounding HTML elements.
This helper class goal is exactly that, given a string containing HTML code it will return an RTF formatted string with the HTML elements colored.
 
I have used Alun Evans code as base, improving its coloring support and performance.
See it's usage in HtmlRenderer project.

Continue reading