Page MenuHomePhabricator

Numbered lists are overzealous
Closed, WontfixPublic

Description

To reproduce:

  1. Live in Germany
  2. Write dates like this:
22. September 2016
  1. Make a list of dates like this:
List of people who died ( https://en.wikipedia.org/wiki/September_29#Deaths )

29. September 2015 – Nawwaf bin Abdulaziz Al Saud, Saudi Arabian prince (b. 1932)
29. September 2015 – Hellmuth Karasek, Czech-German journalist, author, and critic (b. 1934)
29. September 2015 – William Kerslake, American wrestler and engineer (b. 1929)
29. September 2015 – Jean Ter-Merguerian, French-Armenian violinist (b. 1935)
29. September 2015 – Phil Woods, American saxophonist, composer, and bandleader (b. 1931)
  1. Remove the code block and see

List of people who died ( https://en.wikipedia.org/wiki/September_29#Deaths )

  1. September 2015 – Nawwaf bin Abdulaziz Al Saud, Saudi Arabian prince (b. 1932)
  2. September 2015 – Hellmuth Karasek, Czech-German journalist, author, and critic (b. 1934)
  3. September 2015 – William Kerslake, American wrestler and engineer (b. 1929)
  4. September 2015 – Jean Ter-Merguerian, French-Armenian violinist (b. 1935)
  5. September 2015 – Phil Woods, American saxophonist, composer, and bandleader (b. 1931)
  1. Observe the broken dates (the day part) in the above list.

The collection of dates being parsed as an automatically re-numbered list is totally unexpected and can produce obvious (and much worse: subtle -- if you do not start at 29) data corruption.

Event Timeline

GitHub also does this:

Screen Shot 2016-09-22 at 5.03.46 AM.png (295×796 px, 80 KB)
Screen Shot 2016-09-22 at 5.03.50 AM.png (295×781 px, 69 KB)

as does unflavored Markdown:

Screen Shot 2016-09-22 at 5.04.09 AM.png (1×1 px, 149 KB)

I don't immediately see a way to catch these as dates without disrupting other numbered list behaviors or ending up with a very confusing/complex rule (e.g., don't generate a list if every item starts with the full name of a month in English or German).

I think we could possibly make numbered lists stand out a bit more so this is easier to catch (e.g., give the numbers some kind of distinct style to set them apart a bit, visually).

epriestley claimed this task.
epriestley added a subscriber: chad.

Actually, I don't think we can really style the numbers of a numbered list independently of the rest of the list. They aren't directly addressable with CSS and the approaches I've found for doing it rely on using counter(...), which I think is unreasonably complex for this use case:

https://css-tricks.com/numbering-in-style/
http://www.456bereastreet.com/archive/201105/styling_ordered_list_numbers/

We can style the whole list and then try to unstyle the contents, but this is also pretty complex for a tiny benefit.

We could give the entire list some kind of style but I can't immediately imagine how we could do so without adding a lot of weight to the block. We do already indent it, which is a fairly reasonable hint that it's been parsed as markup.

I'm going to close this as something we don't plan to change: all other similar software I can find has similar behavior, and I don't see a way to improve this very rare edge case without unreasonable complexity. Maybe @chad has some idea that I'm missing, but I don't see a way forward here.

You could locally fork PhutilRemarkupListBlockRule to change these rules.