Lettered and roman lists

edit

CommonMark only numbers ordered lists with digits. ListExtras adds the numberings of legal and academic documents: letters (a., B)) and roman numbers (iv., X)), rendered with the type attribute of <ol>, so that the browser numbers the items the same way.

var options = new MarkdownParseOptions { Extensions = MarkdownExtensions.ListExtras };
var tree = MarkdownSyntaxTree.ParseText("iv. Four\nv. Five\n", options);

var list = Assert.IsType<MarkdownListSyntax>(tree.GetRoot().Blocks.Single());
Assert.Equal(MarkdownOrderedListStyle.LowerRoman, list.OrderedStyle);
Assert.Equal(4, list.StartNumber);
Assert.Equal("<ol type=\"i\" start=\"4\">\n<li>Four</li>\n<li>Five</li>\n</ol>\n", MarkdownHtmlRenderer.ToHtml(tree));

MarkdownListSyntax.OrderedStyle gives the numbering, and StartNumber the number of the first item.

i, v and x are roman numbers unless they continue a list of letters, and a list of letters can interrupt a paragraph whatever its first letter.