@@ -306,8 +306,8 @@ class ContentExample {
306306 '<p><em>italic</em> <a href="https://zulip.com/">zulip</a></p>\n '
307307 '</div></div>' ,
308308 [SpoilerNode (
309- header: [ListNode ( ListStyle .ordered, [
310- [ListNode ( ListStyle .unordered, [
309+ header: [OrderedListNode (items : [
310+ [UnorderedListNode (items : [
311311 [HeadingNode (level: HeadingLevel .h2, links: null , nodes: [
312312 TextNode ('hello' ),
313313 ])]
@@ -763,7 +763,7 @@ class ContentExample {
763763 '<div class="message_inline_image">'
764764 '<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png">'
765765 '<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png"></a></div></li>\n </ul>' , [
766- ListNode ( ListStyle .unordered, [[
766+ UnorderedListNode (items : [[
767767 ImageNodeList ([
768768 ImageNode (srcUrl: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' ,
769769 thumbnailUrl: null , loading: false ,
@@ -785,7 +785,7 @@ class ContentExample {
785785 '<div class="message_inline_image">'
786786 '<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png?version=2" title="icon.png">'
787787 '<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png?version=2"></a></div></li>\n </ul>' , [
788- ListNode ( ListStyle .unordered, [[
788+ UnorderedListNode (items : [[
789789 ParagraphNode (wasImplicit: true , links: null , nodes: [
790790 LinkNode (url: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' , nodes: [TextNode ('icon.png' )]),
791791 TextNode (' ' ),
@@ -814,7 +814,7 @@ class ContentExample {
814814 '<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png" title="icon.png">'
815815 '<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png"></a></div>'
816816 'more text</li>\n </ul>' , [
817- ListNode ( ListStyle .unordered, [[
817+ UnorderedListNode (items : [[
818818 const ParagraphNode (wasImplicit: true , links: null , nodes: [
819819 LinkNode (url: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' , nodes: [TextNode ('icon.png' )]),
820820 TextNode (' ' ),
@@ -1382,7 +1382,7 @@ void main() {
13821382 testParse ('<ol>' ,
13831383 // "1. first\n2. then"
13841384 '<ol>\n <li>first</li>\n <li>then</li>\n </ol>' , const [
1385- ListNode ( ListStyle .ordered, [
1385+ OrderedListNode (items : [
13861386 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
13871387 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('then' )])],
13881388 ]),
@@ -1391,7 +1391,7 @@ void main() {
13911391 testParse ('<ul>' ,
13921392 // "* something\n* another"
13931393 '<ul>\n <li>something</li>\n <li>another</li>\n </ul>' , const [
1394- ListNode ( ListStyle .unordered, [
1394+ UnorderedListNode (items : [
13951395 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('something' )])],
13961396 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('another' )])],
13971397 ]),
@@ -1400,7 +1400,7 @@ void main() {
14001400 testParse ('implicit paragraph with internal <br>' ,
14011401 // "* a\n b"
14021402 '<ul>\n <li>a<br>\n b</li>\n </ul>' , const [
1403- ListNode ( ListStyle .unordered, [
1403+ UnorderedListNode (items : [
14041404 [ParagraphNode (wasImplicit: true , links: null , nodes: [
14051405 TextNode ('a' ),
14061406 LineBreakInlineNode (),
@@ -1412,13 +1412,43 @@ void main() {
14121412 testParse ('explicit paragraphs' ,
14131413 // "* a\n\n b"
14141414 '<ul>\n <li>\n <p>a</p>\n <p>b</p>\n </li>\n </ul>' , const [
1415- ListNode ( ListStyle .unordered, [
1415+ UnorderedListNode (items : [
14161416 [
14171417 ParagraphNode (links: null , nodes: [TextNode ('a' )]),
14181418 ParagraphNode (links: null , nodes: [TextNode ('b' )]),
14191419 ],
14201420 ]),
14211421 ]);
1422+
1423+ testParse ('ordered list - large start number (9999)' ,
1424+ // "9999. first\n10000. second"
1425+ '<ol start="9999">\n <li>first</li>\n <li>second</li>\n </ol>' , const [
1426+ OrderedListNode (
1427+ start: 9999 ,
1428+ items: [
1429+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
1430+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('second' )])],
1431+ ]),
1432+ ]);
1433+
1434+ testParse ('ordered list - default start (1)' ,
1435+ '<ol>\n <li>first</li>\n <li>second</li>\n </ol>' , const [
1436+ OrderedListNode (
1437+ items: [
1438+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
1439+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('second' )])],
1440+ ]),
1441+ ]);
1442+
1443+ testParse ('ordered list - custom start (5)' ,
1444+ '<ol start="5">\n <li>fifth</li>\n <li>sixth</li>\n </ol>' , const [
1445+ OrderedListNode (
1446+ start: 5 ,
1447+ items: [
1448+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('fifth' )])],
1449+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('sixth' )])],
1450+ ]),
1451+ ]);
14221452 });
14231453
14241454 testParseExample (ContentExample .spoilerDefaultHeader);
@@ -1451,7 +1481,7 @@ void main() {
14511481 testParse ('link in list item' ,
14521482 // "* [t](/u)"
14531483 '<ul>\n <li><a href="/u">t</a></li>\n </ul>' , const [
1454- ListNode ( ListStyle .unordered, [
1484+ UnorderedListNode (items : [
14551485 [ParagraphNode (links: null , wasImplicit: true , nodes: [
14561486 LinkNode (url: '/u' , nodes: [TextNode ('t' )]),
14571487 ])],
@@ -1509,10 +1539,10 @@ void main() {
15091539 '<ol>\n <li>\n <blockquote>\n <h6>two</h6>\n <ul>\n <li>three</li>\n '
15101540 '</ul>\n </blockquote>\n <div class="codehilite"><pre><span></span>'
15111541 '<code>four\n </code></pre></div>\n\n </li>\n </ol>' , const [
1512- ListNode ( ListStyle .ordered, [[
1542+ OrderedListNode (items : [[
15131543 QuotationNode ([
15141544 HeadingNode (level: HeadingLevel .h6, links: null , nodes: [TextNode ('two' )]),
1515- ListNode ( ListStyle .unordered, [[
1545+ UnorderedListNode (items : [[
15161546 ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('three' )]),
15171547 ]]),
15181548 ]),
0 commit comments