Skip to content

Commit

Permalink
don't run the image/anchor regexes in singleline-mode. That 1) seems …
Browse files Browse the repository at this point in the history
…pointless, and 2) is inconsistent with PageDown: http://meta.stackexchange.com/q/251000
  • Loading branch information
balpha committed Jun 22, 2015
1 parent da7b747 commit e0fe9ca
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions MarkdownSharp/Markdown.cs
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ [ ]? # one optional space
\[
(.*?) # id = $3
\]
)", GetNestedBracketsPattern()), RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
)", GetNestedBracketsPattern()), RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);

private static Regex _anchorInline = new Regex(string.Format(@"
( # wrap whole match in $1
Expand All @@ -819,14 +819,14 @@ [ ]*
)? # title is optional
\)
)", GetNestedBracketsPattern(), GetNestedParensPattern()),
RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);

private static Regex _anchorRefShortcut = new Regex(@"
( # wrap whole match in $1
\[
([^\[\]]+) # link text = $2; can't contain [ or ]
\]
)", RegexOptions.Singleline | RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);
)", RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);

/// <summary>
/// Turn Markdown link shortcuts into HTML anchor tags
Expand Down Expand Up @@ -964,7 +964,7 @@ [ ]? # one optional space
(.*?) # id = $3
\]
)", RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline | RegexOptions.Compiled);
)", RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);

private static Regex _imagesInline = new Regex(String.Format(@"
( # wrap whole match in $1
Expand All @@ -984,7 +984,7 @@ [ ]*
)? # title is optional
\)
)", GetNestedParensPattern()),
RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline | RegexOptions.Compiled);
RegexOptions.IgnorePatternWhitespace | RegexOptions.Compiled);

/// <summary>
/// Turn Markdown image shortcuts into HTML img tags.
Expand Down

0 comments on commit e0fe9ca

Please sign in to comment.