tpope / vim-markdown

Vim Markdown runtime files
1.22k stars 191 forks source link

Support more kinds of lists #198

Closed amarakon closed 1 year ago

amarakon commented 1 year ago

Currently, The only Markdown ordered lists for vim-markdown that are supported are numbered ones with a period (e.g. 1., 2.). However, there are more types of lists. You can use letters (e.g. a., b.) and even hashtags if you use Pandoc Markdown (#.). Additionally, you do not have to put a period, you can put a closing parentheses instead (#)). I believe these changes should also be the default for the main Vim repository but I am pull requesting here first.

tpope commented 1 year ago

You can use letters

According to who? It's not in the original spec. It's not in Common Mark. It doesn't work on GitHub either:

a. Is this a list? b. No, it is not.

It also creates false positives everywhere. Here's 2 in the Fugitive README, literally the first file I tested.

amarakon commented 1 year ago

According to who? It's not in the original spec. It's not in Common Mark. It doesn't work on GitHub either:

It works in Pandoc and R Markdown. Pandoc Markdown documents are most often written in .md files, thus the markdown file type is used. R Markdown is based on Markdown.

It also creates false positives everywhere. Here's 2 in the Fugitive README, literally the first file I tested.

Then I can create a new commit that makes it so that if you use a lettered list, there needs to be only one letter. No more false positives. There is no way in the English language (and other languages that I know of) where you can have a sentence ending with a one-letter word.

alerque commented 1 year ago

This is not the only thing Pandoc does differently in Pandoc flavored markdown that is not "standard" by any definition (not the original, not command mark, not in many widely used implementations). Many implementations do follow suit and implement bits of Pandoc flavor. If you want Pandoc support I suggest a specific plugin for it such as vim-pandoc-syntax. You'll have to decide if you want *.md files to default to the markdown filetype or pandoc filetype, then override for any cases where your chosen default needs adjusting.

amarakon commented 1 year ago

You can use letters

According to who? It's not in the original spec. It's not in Common Mark. It doesn't work on GitHub either:

a. Is this a list? b. No, it is not.

It also creates false positives everywhere. Here's 2 in the Fugitive README, literally the first file I tested.

I fixed it, there are no longer any false positives that you showed from my testing. Check my latest GitHub master. There should be no disadvantages for this other than the fact that people who are not using Pandoc or R Markdown will get false positives if the use the Pandoc syntax.