Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Improved

  • Loading branch information...
commit 86c711f9fa8dcf448770d8da05e072bc068ca295 1 parent 5757519
@Dynalon authored
View
1  .gitignore
@@ -7,4 +7,3 @@ bin/
*.userprefs
*.DS_Store
*.AppleDouble
-*.actual.html
View
5 MarkdownSharp/Markdown.cs
@@ -396,11 +396,14 @@ protected string DoAddBumper (string text)
/// </summary>
private string RunBlockGamut(string text)
{
+ text = DoBlockQuotes(text);
+ // save those blockquotes from DoAddBumper
+ text = HashHTMLBlocks (text);
+
text = DoHeaders(text);
text = DoHorizontalRules(text);
text = DoLists(text);
- text = DoBlockQuotes(text);
text = DoAddBumper (text);
// We already ran HashHTMLBlocks() before, in Markdown(), but that
View
13 MarkdownSharpTests/SimpleTests.cs
@@ -264,11 +264,22 @@ public void AutoNewLines ()
[Test]
public void ReplaceOverlongSpacesBySpan ()
{
- string input = "This text has overlong spaces.\n";
+ string input = "This text has overlong spaces.\n";
string expected= "<p>This text has<span class='bumper'>overlong spaces.</span></p>\n";
string actual = m.Transform (input);
Assert.AreEqual (expected, actual);
}
+ [Test]
+ public void GitHubLikeCodeBlocks ()
+ {
+ // test if codeblock with three backticks are correctly encoded
+ // note that it is correct that the first linebreak after ``` gets removed
+ string input = "```\nCodeBlock\n```";
+ string expected = "<pre><code>CodeBlock\n</code></pre>\n";
+
+ string actual = m.Transform (input);
+ Assert.AreEqual (expected, actual);
+ }
}
}

0 comments on commit 86c711f

Please sign in to comment.
Something went wrong with that request. Please try again.