Skip to content

Latest commit

 

History

History
80 lines (61 loc) · 1.73 KB

README.md

File metadata and controls

80 lines (61 loc) · 1.73 KB

Marked .NET

Build status NuGet Version NuGet Downloads

A full-featured markdown parser and compiler, written in C#. Port of original marked javascript project.

Example of usage

Here is an example of typical using of library:

var markdown = @"
Heading
=======

Sub-heading
-----------

### Another deeper heading

Paragraphs are separated
by a blank line.

Leave 2 spaces at the end of a line to do a  
line break

Text attributes *italic*, **bold**,
`monospace`, ~~strikethrough~~ .

A [link](http://example.com).

Shopping list:

* apples
* oranges
* pears

Numbered list:

1. apples
2. oranges
3. pears
";

var marked = new Marked();
var html = marked.Parse(markdown);

Output:

<h1 id="heading">Heading</h1>
<h2 id="sub-heading">Sub-heading</h2>
<h3 id="another-deeper-heading">Another deeper heading</h3>
<p>Paragraphs are separated
by a blank line.</p>
<p>Leave 2 spaces at the end of a line to do a<br>line break</p>
<p>Text attributes <em>italic</em>, <strong>bold</strong>,
<code>monospace</code>, <del>strikethrough</del> .</p>
<p>A <a href="http://example.com">link</a>.
</p>
<p>Shopping list:</p>
<ul>
<li>apples</li>
<li>oranges</li>
<li>pears</li>
</ul>
<p>Numbered list:</p>
<ol>
<li>apples</li>
<li>oranges</li>
<li>pears</li>
</ol>

Get it on NuGet!

Install-Package MarkedNet

License

MarkedNet is under the MIT license.