Closed chaojian-zhang closed 5 years ago
As far as the commonmark specification goes, ordered list must start with 1.
Source: https://spec.commonmark.org/0.29/#ordered-list-marker
I checked the spec and think the line "An ordered list marker is a sequence of 1–9 arabic digits (0-9), followed by either a . character or a ) character." clearly allows it.
Also see this discussion.
Thanks.
I guess you misunderstand the spec. It clearly states that it must start with 1. That's what sequence 1-9 means. And later in the paragraph it is even more explicit: the start number must be 1.
In any case, markdig.wpf relies on what the markdig library parses. So if you think it is a bug, you should open an issue there.
But as can be seen in the babelmark benchmark, all commonmark-complying implementations don't support 0 as a starting index.
Final note, this exception happens in WPF (PresentationFramework) implementation of List (in namespace System.Windows.Documents), so there is nothing I can do about it unfortunately:
The
Markdown
property of MarkdownViewer control seem not able to have 0 in a numbered list. An ArgumentException will be thrown saying0 is not a valid StartIndex
.I am not sure whether this is related to
MarkdownPipelineBuilder
or I need to enable someUseSupportedExtensions()
?VS Setup: MarkdigWPFNumberList.zip