Browse Source

Markdown.pl: do not mishandle double list markers redux

In b7f3fc1c (Markdown.pl: do not mishandle double list markers,
2017-01-09, markdown_1.1.0), an attempt was made to avoid
having something like "* 1. item" be misinterpreted as an
unordered list containing an ordered sublist.

However, the change made to fix the problem only introduced
another problem where lists were not always being recognized
when they should be.

Fix the fix (it did have a bit of a kludgely side to it) so
it works properly and is less kludgely.

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

4
Markdown.pl

@ -452,7 +452,7 @@ sub Markdown {
# Strip link definitions, store in hashes.
$text = _StripLinkDefinitions($text);
$text = _RunBlockGamut("\n".$text, 1);
$text = _RunBlockGamut($text, 1);
# Unhashify code blocks
$text =~ s/(\005\d+\006)/$g_code_blocks{$1}/g;
@ -1337,7 +1337,7 @@ sub _DoLists {
my $whole_list = qr{
( # $1 (or $_[0]) = whole list
( # $2 (or $_[1])
(?<=\n)
(?:(?<=\n)|\A)
[ ]{0,$less_than_indent}
(${marker_any}) # $3 (or $_[2]) = first list item marker
[ ]+

Loading…
Cancel
Save