From 0244be2aadc65b805a61851f9235f119ac96a093 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Tue, 14 Jul 2015 11:48:43 -0700 Subject: Added 9-digit limit on ordered list start number. Intent is to avoid problems with overflows. See http://talk.commonmark.org/t/what-is-or-what-should-be-the-range-of-indices-of-ordered-list-items/1249 Some browsers use signed 32-bit integers for indexing the items of an ordered list, and this can lead to odd or undefined behavior if 10-digit start numbers are allowed. --- spec.txt | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) (limited to 'spec.txt') diff --git a/spec.txt b/spec.txt index 9b5e9dc..4062998 100644 --- a/spec.txt +++ b/spec.txt @@ -3104,8 +3104,10 @@ A [bullet list marker](@bullet-list-marker) is a `-`, `+`, or `*` character. An [ordered list marker](@ordered-list-marker) -is a sequence of one of more digits (`0-9`), followed by either a -`.` character or a `)` character. +is a sequence of 1--9 arabic digits (`0-9`), followed by either a +`.` character or a `)` character. (The reason for the length +limit is that with 10 digits we start seeing integer overflows +in some browsers.) The following rules define [list items]: @@ -3374,6 +3376,49 @@ A list item may contain any kind of block: . +Note that ordered list start numbers must be nine digits or less: + +. +123456789. ok +. +
    +
  1. ok
  2. +
+. + +. +1234567890. not ok +. +

1234567890. not ok

+. + +A start number may begin with 0s: + +. +0. ok +. +
    +
  1. ok
  2. +
+. + +. +003. ok +. +
    +
  1. ok
  2. +
+. + +A start number may not be negative: + +. +-1. not ok +. +

-1. not ok

+. + + 2. **Item starting with indented code.** If a sequence of lines *Ls* constitute a sequence of blocks *Bs* starting with an indented code block and not separated from each other by more than one blank line, -- cgit v1.2.3