Skip to content

Instantly share code, notes, and snippets.

@khalidabuhakmeh
Created December 11, 2015 13:07
Show Gist options
  • Save khalidabuhakmeh/c4a74f6998e45364e7ac to your computer and use it in GitHub Desktop.
Save khalidabuhakmeh/c4a74f6998e45364e7ac to your computer and use it in GitHub Desktop.
OctoKit is totally fine.
using System;
using Octokit;
using System.Linq;
public class Program
{
public static void Main()
{
var client = new GitHubClient(new ProductHeaderValue("test"));
var release = client.Release.GetAll("aspnet", "razor").Result.First();
int count = release.Body.Split(new [] { "\r\n" }, StringSplitOptions.None).Length - 1;
Console.WriteLine("There are {0} newlines", count);
var html = client.Miscellaneous.RenderRawMarkdown(release.Body).Result;
Console.WriteLine(html);
}
}
@khalidabuhakmeh
Copy link
Author

results in the output

There are 13 newlines
<h3>
<a id="user-content-features" class="anchor" href="#features" aria-hidden="true"><span class="octicon octicon-link"></span></a>Features</h3>

<ul>
<li>API namespace cleanup for tag helpers (<a href="https://github.com/aspnet/Razor/issues/578">#578</a>)</li>
<li>Refactor WriteAttribute API surface. (<a href="https://github.com/aspnet/Razor/issues/177">#177</a>)</li>
</ul>

<h3>
<a id="user-content-bugs-fixed" class="anchor" href="#bugs-fixed" aria-hidden="true"><span class="octicon octicon-link"></span></a>Bugs Fixed</h3>

<ul>
<li>Multiple TagHelpers targeting same element cannot effectively communicate to children. (<a href="https://github.com/aspnet/Razor/issues/571">#571</a>)</li>
<li>Compilation error within tag attribute shows generated code instead of markup (<a href="https://github.com/aspnet/Razor/issues/569">#569</a>)</li>
<li>Specifying <code>RestrictChildren</code> and empty <code>HtmlTargetElement</code> results in an error (<a href="https://github.com/aspnet/Razor/issues/562">#562</a>)</li>
<li>
<code>TreeStructureChanged</code> marked as <code>true</code> when whitespace is added to a page with <code>TagHelper</code>s (<a href="https://github.com/aspnet/Razor/issues/553">#553</a>)</li>
<li>Expose <code>FilePath</code> on <code>MappingLocation</code> to let Razor editor know mapping origination. (<a href="https://github.com/aspnet/Razor/issues/552">#552</a>)</li>
</ul>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment