Skip to content

Instantly share code, notes, and snippets.

@NathanCastle
Created November 9, 2015 20:24
Show Gist options
  • Save NathanCastle/b3ca963a0cef55b664a4 to your computer and use it in GitHub Desktop.
Save NathanCastle/b3ca963a0cef55b664a4 to your computer and use it in GitHub Desktop.
CommonMark rendering issue with HTML - example
using System;
using CommonMark;
namespace commonmarkdemo
{
class MainClass
{
public static void Main (string[] args)
{
string spaceresult = CommonMark.CommonMarkConverter.Convert (@"# title
Everything below this should be pure HTML, not code:
<table>
<thead>
<tr>
<td>Head 1</td>
<td>Head 2</td>
</tr>
<thead>
<tbody>
<!-- We don't want this interpreted as code, but it is. -->
<tr>
<td>cell1</td>
<td>cell1</td>
</tr>
</tbody>
</table>");
string nospaceresult = CommonMark.CommonMarkConverter.Convert (@"# title
Everything below this should be pure HTML, not code:
<table>
<thead>
<tr>
<td>Head 1</td>
<td>Head 2</td>
</tr>
<thead>
<tbody>
<!-- We don't want this interpreted as code, and it isn't. -->
<tr>
<td>cell1</td>
<td>cell1</td>
</tr>
</tbody>
</table>");
Console.WriteLine (spaceresult);
Console.WriteLine ("=============");
Console.WriteLine (nospaceresult);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment