From d87f4abdb17f81c9deeb60b9810adeb784908b95 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Wed, 27 Dec 2017 05:13:12 -0800 Subject: [PATCH] Markdown.pl: improve XML comment parsing Use the actual XML comment rule for parsing XML comments. The leading delimiter is fixed as "". In between the leading and trailing delimiters any characters other than a "-" may be used and a "-" may be used provided it's followed immediately with a non-"-" character. Now that the clear beginning and end of comments can be properly identified, there no longer needs to be a blank line following the comment -- the end delimiter serves quite unambiguously. Relax the ending match to just be end of line or end of document. This makes comments parse much more like they're expected to. Signed-off-by: Kyle J. McKay --- Markdown.pl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Markdown.pl b/Markdown.pl index 66e6d45..aa13c36 100755 --- a/Markdown.pl +++ b/Markdown.pl @@ -662,12 +662,12 @@ sub _HashHTMLBlocks { ( # save in $1 [ ]{0,$less_than_indent} (?s: - + ) [ ]* - (?=\n{2,}|\Z) # followed by a blank line or end of document + (?=\n{1,}|\Z) # followed by end of line or end of document ) }{ my $key = block_id($1);