From 8406a08bf6a9c2e081724c4375fa928df780522a Mon Sep 17 00:00:00 2001 From: Daniel Stolt Date: Wed, 4 Feb 2015 16:27:17 +0100 Subject: [PATCH] Fixed a weird bug in Markdown that caused

elements to be nested in

elements. --- src/Orchard.Web/Modules/Markdown/Markdown.cs | 32 ++++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Orchard.Web/Modules/Markdown/Markdown.cs b/src/Orchard.Web/Modules/Markdown/Markdown.cs index a4e2f3689..68d33db69 100644 --- a/src/Orchard.Web/Modules/Markdown/Markdown.cs +++ b/src/Orchard.Web/Modules/Markdown/Markdown.cs @@ -606,25 +606,25 @@ namespace MarkdownSharp // Regular expression for the content of a block tag. string attr = @" - (?>    # optional tag attributes - \s   # starts with whitespace + (?> # optional tag attributes + \s # starts with whitespace (?> - [^>""/]+ # text outside quotes + [^>""/]+ # text outside quotes | - /+(?!>)  # slash not followed by > + /+(?!>) # slash not followed by > | - ""[^""]*""  # text inside double quotes (tolerate >) + ""[^""]*"" # text inside double quotes (tolerate >) | - '[^']*' # text inside single quotes (tolerate >) + '[^']*' # text inside single quotes (tolerate >) )* - )? + )? "; string content = RepeatString(@" (?> - [^<]+   # content without tag + [^<]+ # content without tag | - <\2   # nested opening tag + <\2 # nested opening tag " + attr + @" # attributes (?> /> @@ -632,9 +632,9 @@ namespace MarkdownSharp >", _nestDepth) + // end of opening tag ".*?" + // last level nested tag content RepeatString(@" -  # closing nested tag + # closing nested tag ) - |    + | <(?!/\2\s*> # other tags with a different name ) )*", _nestDepth); @@ -642,11 +642,11 @@ namespace MarkdownSharp string content2 = content.Replace(@"\2", @"\3"); // First, look for nested blocks, e.g.: - // 

- //  
- //   tags for inner block must be indented. - //  
- // 
+ //
+ //
+ // tags for inner block must be indented. + //
+ //
// // The outermost tags must start at the left margin for this to match, and // the inner nested divs must be indented.