numbered list bug in markdown.pl?
Seumas Mac Uilleachan
seumas at idirect.ca
Wed Jul 19 19:31:03 EDT 2006
Waylan Limberg wrote:
> On 7/12/06, Michel Fortin <michel.fortin at michelf.com> wrote:
> [snip]
>> Personally, I'd go the route of requiring an increasing character
>> count for numeric markers when they are right-aligned because I think
>> it is the less damaging thing to do to current Markdown text and
>> because it makes sense visually. The previous example would be
>> equivalent to this:
>>
>> 1. List item
>> 10. List item
>> 20. List item
>> 2. List item
>>
>> As would this:
>>
>> 1. List item
>> 2. List item
>> 3. List item
>> 4. List item
>>
>> Not perfect, as it still breaks the rule saying you can use any
>> number as list marker when numbers are more than one character and
>> right-aligned, but it is the best compromise I can think of. What do
>> you think?
>>
> That is how the python implementation currently works with one
> exception. The fourth item would not be a sublist as it is not
> indented by at least 4 spaces. The thing about enforcing at least four
> spaces is that it allows right aligning numbers up to three digits
> without interference. I realize many people using perl/php/other
> implementations may have many documents which do not strictly indent
> sublists at least four spaces though, so that is a backward
> compatibility issue. However, that is the so called "undocumented
> feature" which the documentation actually does not seem to support. It
> says:
>
>> List markers typically start at the left margin, but may be
>> indented by up to three spaces. List markers must be
>> followed by one or more spaces or a tab.
>
> That would indicate that three spaces or less would never create a
> sublist. IMHO all those people who have been using only one space for
> a sublist are just being lazy and when the bug is fixed their laziness
> will bit them back. Perhaps that sounds harsh, but as A. Pagaltzis
> said:
>
> On 7/12/06, A. Pagaltzis <pagaltzis at gmx.de> wrote:
>> I think requiring more indentation won't make Markdown
>> unduly harder to write but it will definitely make documents
>> more readable.
>
> Which as I understand it, is the goal of markdown in the first place.
>
I would have to agree with this logic. I use the PHP version of markdown
and I have always indented sublists with four spaces because that was
how the syntax documentation said to do it and because it makes the
unformatted text more readable. Using one space as in some of the
examples above leads to ambiguity into what is part of teh list and what
is supposed to be a sublist. The whole idea of markdown is to eliminate
(or at least greatly reduce) the ambiguity of the unformatted text.
A script can be written to reformat (ie add spaces) the lists for those
who used less than four spaces if this "bug" is fixed. But likely not by
me :)
More information about the Markdown-Discuss
mailing list