@@ -269,6 +269,26 @@ class ContentExample {
269269 url: '/#narrow/channel/378-api-design/topic/notation.20for.20near.20links/near/1972281' ,
270270 nodes: [TextNode ('#api design > notation for near links @ 💬' )]));
271271
272+ static const orderedListCustomStart = ContentExample (
273+ 'ordered list with custom start' ,
274+ '5. fifth\n 6. sixth' ,
275+ '<ol start="5">\n <li>fifth</li>\n <li>sixth</li>\n </ol>' ,
276+ [OrderedListNode (start: 5 , [
277+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('fifth' )])],
278+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('sixth' )])],
279+ ])],
280+ );
281+
282+ static const orderedListLargeStart = ContentExample (
283+ 'ordered list with large start number' ,
284+ '9999. first\n 10000. second' ,
285+ '<ol start="9999">\n <li>first</li>\n <li>second</li>\n </ol>' ,
286+ [OrderedListNode (start: 9999 , [
287+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
288+ [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('second' )])],
289+ ])],
290+ );
291+
272292 static const spoilerDefaultHeader = ContentExample (
273293 'spoiler with default header' ,
274294 '```spoiler\n hello world\n ```' ,
@@ -306,8 +326,8 @@ class ContentExample {
306326 '<p><em>italic</em> <a href="https://zulip.com/">zulip</a></p>\n '
307327 '</div></div>' ,
308328 [SpoilerNode (
309- header: [ListNode ( ListStyle .ordered , [
310- [ListNode ( ListStyle .unordered, [
329+ header: [OrderedListNode (start : 1 , [
330+ [UnorderedListNode ( [
311331 [HeadingNode (level: HeadingLevel .h2, links: null , nodes: [
312332 TextNode ('hello' ),
313333 ])]
@@ -836,7 +856,7 @@ class ContentExample {
836856 '<div class="message_inline_image">'
837857 '<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png">'
838858 '<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png"></a></div></li>\n </ul>' , [
839- ListNode ( ListStyle .unordered, [[
859+ UnorderedListNode ( [[
840860 ImageNodeList ([
841861 ImageNode (srcUrl: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' ,
842862 thumbnailUrl: null , loading: false ,
@@ -858,7 +878,7 @@ class ContentExample {
858878 '<div class="message_inline_image">'
859879 '<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png?version=2" title="icon.png">'
860880 '<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png?version=2"></a></div></li>\n </ul>' , [
861- ListNode ( ListStyle .unordered, [[
881+ UnorderedListNode ( [[
862882 ParagraphNode (wasImplicit: true , links: null , nodes: [
863883 LinkNode (url: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' , nodes: [TextNode ('icon.png' )]),
864884 TextNode (' ' ),
@@ -887,7 +907,7 @@ class ContentExample {
887907 '<a href="https://chat.zulip.org/user_avatars/2/realm/icon.png" title="icon.png">'
888908 '<img src="https://chat.zulip.org/user_avatars/2/realm/icon.png"></a></div>'
889909 'more text</li>\n </ul>' , [
890- ListNode ( ListStyle .unordered, [[
910+ UnorderedListNode ( [[
891911 const ParagraphNode (wasImplicit: true , links: null , nodes: [
892912 LinkNode (url: 'https://chat.zulip.org/user_avatars/2/realm/icon.png' , nodes: [TextNode ('icon.png' )]),
893913 TextNode (' ' ),
@@ -1559,7 +1579,7 @@ void main() {
15591579 testParse ('<ol>' ,
15601580 // "1. first\n2. then"
15611581 '<ol>\n <li>first</li>\n <li>then</li>\n </ol>' , const [
1562- ListNode ( ListStyle .ordered , [
1582+ OrderedListNode (start : 1 , [
15631583 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('first' )])],
15641584 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('then' )])],
15651585 ]),
@@ -1568,7 +1588,7 @@ void main() {
15681588 testParse ('<ul>' ,
15691589 // "* something\n* another"
15701590 '<ul>\n <li>something</li>\n <li>another</li>\n </ul>' , const [
1571- ListNode ( ListStyle .unordered, [
1591+ UnorderedListNode ( [
15721592 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('something' )])],
15731593 [ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('another' )])],
15741594 ]),
@@ -1577,7 +1597,7 @@ void main() {
15771597 testParse ('implicit paragraph with internal <br>' ,
15781598 // "* a\n b"
15791599 '<ul>\n <li>a<br>\n b</li>\n </ul>' , const [
1580- ListNode ( ListStyle .unordered, [
1600+ UnorderedListNode ( [
15811601 [ParagraphNode (wasImplicit: true , links: null , nodes: [
15821602 TextNode ('a' ),
15831603 LineBreakInlineNode (),
@@ -1589,13 +1609,16 @@ void main() {
15891609 testParse ('explicit paragraphs' ,
15901610 // "* a\n\n b"
15911611 '<ul>\n <li>\n <p>a</p>\n <p>b</p>\n </li>\n </ul>' , const [
1592- ListNode ( ListStyle .unordered, [
1612+ UnorderedListNode ( [
15931613 [
15941614 ParagraphNode (links: null , nodes: [TextNode ('a' )]),
15951615 ParagraphNode (links: null , nodes: [TextNode ('b' )]),
15961616 ],
15971617 ]),
15981618 ]);
1619+
1620+ testParseExample (ContentExample .orderedListCustomStart);
1621+ testParseExample (ContentExample .orderedListLargeStart);
15991622 });
16001623
16011624 testParseExample (ContentExample .spoilerDefaultHeader);
@@ -1628,7 +1651,7 @@ void main() {
16281651 testParse ('link in list item' ,
16291652 // "* [t](/u)"
16301653 '<ul>\n <li><a href="/u">t</a></li>\n </ul>' , const [
1631- ListNode ( ListStyle .unordered, [
1654+ UnorderedListNode ( [
16321655 [ParagraphNode (links: null , wasImplicit: true , nodes: [
16331656 LinkNode (url: '/u' , nodes: [TextNode ('t' )]),
16341657 ])],
@@ -1695,10 +1718,10 @@ void main() {
16951718 '<ol>\n <li>\n <blockquote>\n <h6>two</h6>\n <ul>\n <li>three</li>\n '
16961719 '</ul>\n </blockquote>\n <div class="codehilite"><pre><span></span>'
16971720 '<code>four\n </code></pre></div>\n\n </li>\n </ol>' , const [
1698- ListNode ( ListStyle .ordered , [[
1721+ OrderedListNode (start : 1 , [[
16991722 QuotationNode ([
17001723 HeadingNode (level: HeadingLevel .h6, links: null , nodes: [TextNode ('two' )]),
1701- ListNode ( ListStyle .unordered, [[
1724+ UnorderedListNode ( [[
17021725 ParagraphNode (wasImplicit: true , links: null , nodes: [TextNode ('three' )]),
17031726 ]]),
17041727 ]),
0 commit comments