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(@" - \2\s*> # closing nested tag + \2\s*> # 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.: - //