-
Notifications
You must be signed in to change notification settings - Fork 30
Open
Description
Same example as #3.
static void Main(string[] args)
{
var highlighter = new Highlighter(new HtmlEngine());
var s = @" static void Main(string[] args)
{
var highlighter = new Highlighter(new HtmlEngine());
var s = @"";
var highlightedCode = highlighter.Highlight(""C#"", s);
Console.Write(highlightedCode);
Console.ReadKey();
}";
var highlightedCode = "<pre>" + highlighter.Highlight("C#", s) + "</pre>";
Console.Write(highlightedCode);
Console.ReadKey();
}output:
<pre><span style="color: Black;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;"> <span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">static</span> <span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">void</span> Main(<span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">string</span>[] args)
{
var highlighter <span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">=</span> <span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">new</span> Highlighter(<span style="color: Blue;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">new</span> HtmlEngine());
var s <span style="color: Red;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">=</span> <span style="color: #666666;background-color: Transparent;font-family: Courier New;font-size: 11px;font-weight: normal;">@";
var highlightedCode = highlighter.Highlight("</span>C#", s);
Console.Write(highlightedCode);
Console.ReadKey();
}</span></pre>Metadata
Metadata
Assignees
Labels
No labels
