Skip to content

Commit 9ba8899

Browse files
author
esskar
committed
do not add any whitespaces to the beginning of an article
1 parent 8d779b2 commit 9ba8899

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

MarkdownSharp/Markdown.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,7 @@ private string ArticleEvaluator(Match match)
14211421
article = Regex.Replace(article, @"^[ ]+$", "", RegexOptions.Multiline); // trim whitespace-only lines
14221422
article = RunBlockGamut(article); // recurse
14231423

1424-
article = Regex.Replace(article, @"^", " ", RegexOptions.Multiline);
1424+
//article = Regex.Replace(article, @"^", " ", RegexOptions.Multiline);
14251425

14261426
// These leading spaces screw with <pre> content, so we need to fix that:
14271427
article = Regex.Replace(article, @"(\s*<pre>.+?</pre>)", ArticleEvaluator2, RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);

MarkdownSharpTests/SimpleTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void ArticleEnabled()
116116
_target.SupportArticles = true;
117117

118118
const string input = "Here is an article\n\n$ Hello sir!\n";
119-
const string expected = "<p>Here is an article</p>\n\n<article>\n <p>Hello sir!</p>\n</article>\n";
119+
const string expected = "<p>Here is an article</p>\n\n<article>\n<p>Hello sir!</p>\n</article>\n";
120120

121121
var actual = _target.Transform(input);
122122
Assert.AreEqual(expected, actual);

0 commit comments

Comments
 (0)