Browse Source

Markdown.pl: allow empty first blockquote line

Previously this:

    >
    This should be a block quote now

Would not get recognized as a blockquote, now it will.

Previously the lone ">" got left on the line all by
itself as though it had been escaped.

Clearly that was improper.

Alternatively, it could have been picked up as its very
own empty blockquote, but that seems like the less
desirable resolution for the issue.

A ">" at the beginning of a line always signals the beginning
of a blockquote (unless it's escaped) and that blockquote then
continues on until it encounters a blank line.

Therefore the new interpretation must be correct, the old
interpretation was clearly wrong and the "empty blockquote
of its own" interpretation is also clearly wrong since it's
not immediately followed by a blank line.  But this:

    >

    This will not be a block quote

With the blank line inserted, the above ">" does really now
end up correctly in an "empty blockquote of its own".

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
master
Kyle J. McKay 5 years ago
parent
commit
7a1371277e
  1. 2
      Markdown.pl

2
Markdown.pl

@ -1797,7 +1797,7 @@ sub _DoBlockQuotes {
( # Wrap whole match in $1
(
^[ ]*>[ ]? # '>' at the start of a line
.+\n # rest of the first line
.*\n # rest of the first line
(.+\n)* # subsequent consecutive lines
\n* # blanks
)+

Loading…
Cancel
Save