Skip to content

Commit 3a26c13

Browse files
committed
Fix spread on nested lists
1 parent 6f50b5e commit 3a26c13

File tree

3 files changed

+373
-3
lines changed

3 files changed

+373
-3
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,8 @@ function compiler(options) {
290290
tailEvent[1].type === types.linePrefix ||
291291
tailEvent[1].type === types.blockQuotePrefix ||
292292
tailEvent[1].type === types.blockQuotePrefixWhitespace ||
293-
tailEvent[1].type === types.blockQuoteMarker
293+
tailEvent[1].type === types.blockQuoteMarker ||
294+
tailEvent[1].type === types.listItemIndent
294295
) {
295296
// Empty
296297
} else {

test/fixtures/list.json

Lines changed: 361 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1338,6 +1338,365 @@
13381338
"offset": 178
13391339
}
13401340
}
1341+
},
1342+
{
1343+
"type": "list",
1344+
"ordered": false,
1345+
"start": null,
1346+
"spread": false,
1347+
"children": [
1348+
{
1349+
"type": "listItem",
1350+
"spread": true,
1351+
"checked": null,
1352+
"children": [
1353+
{
1354+
"type": "paragraph",
1355+
"children": [
1356+
{
1357+
"type": "text",
1358+
"value": "y",
1359+
"position": {
1360+
"start": {
1361+
"line": 51,
1362+
"column": 3,
1363+
"offset": 182
1364+
},
1365+
"end": {
1366+
"line": 51,
1367+
"column": 4,
1368+
"offset": 183
1369+
}
1370+
}
1371+
}
1372+
],
1373+
"position": {
1374+
"start": {
1375+
"line": 51,
1376+
"column": 3,
1377+
"offset": 182
1378+
},
1379+
"end": {
1380+
"line": 51,
1381+
"column": 4,
1382+
"offset": 183
1383+
}
1384+
}
1385+
},
1386+
{
1387+
"type": "list",
1388+
"ordered": true,
1389+
"start": 1,
1390+
"spread": true,
1391+
"children": [
1392+
{
1393+
"type": "listItem",
1394+
"spread": false,
1395+
"checked": null,
1396+
"children": [
1397+
{
1398+
"type": "paragraph",
1399+
"children": [
1400+
{
1401+
"type": "text",
1402+
"value": "z",
1403+
"position": {
1404+
"start": {
1405+
"line": 53,
1406+
"column": 6,
1407+
"offset": 190
1408+
},
1409+
"end": {
1410+
"line": 53,
1411+
"column": 7,
1412+
"offset": 191
1413+
}
1414+
}
1415+
}
1416+
],
1417+
"position": {
1418+
"start": {
1419+
"line": 53,
1420+
"column": 6,
1421+
"offset": 190
1422+
},
1423+
"end": {
1424+
"line": 53,
1425+
"column": 7,
1426+
"offset": 191
1427+
}
1428+
}
1429+
}
1430+
],
1431+
"position": {
1432+
"start": {
1433+
"line": 53,
1434+
"column": 3,
1435+
"offset": 187
1436+
},
1437+
"end": {
1438+
"line": 53,
1439+
"column": 7,
1440+
"offset": 191
1441+
}
1442+
}
1443+
},
1444+
{
1445+
"type": "listItem",
1446+
"spread": false,
1447+
"checked": null,
1448+
"children": [
1449+
{
1450+
"type": "paragraph",
1451+
"children": [
1452+
{
1453+
"type": "text",
1454+
"value": "a",
1455+
"position": {
1456+
"start": {
1457+
"line": 55,
1458+
"column": 6,
1459+
"offset": 198
1460+
},
1461+
"end": {
1462+
"line": 55,
1463+
"column": 7,
1464+
"offset": 199
1465+
}
1466+
}
1467+
}
1468+
],
1469+
"position": {
1470+
"start": {
1471+
"line": 55,
1472+
"column": 6,
1473+
"offset": 198
1474+
},
1475+
"end": {
1476+
"line": 55,
1477+
"column": 7,
1478+
"offset": 199
1479+
}
1480+
}
1481+
}
1482+
],
1483+
"position": {
1484+
"start": {
1485+
"line": 55,
1486+
"column": 3,
1487+
"offset": 195
1488+
},
1489+
"end": {
1490+
"line": 55,
1491+
"column": 7,
1492+
"offset": 199
1493+
}
1494+
}
1495+
}
1496+
],
1497+
"position": {
1498+
"start": {
1499+
"line": 53,
1500+
"column": 3,
1501+
"offset": 187
1502+
},
1503+
"end": {
1504+
"line": 56,
1505+
"column": 3,
1506+
"offset": 202
1507+
}
1508+
}
1509+
}
1510+
],
1511+
"position": {
1512+
"start": {
1513+
"line": 51,
1514+
"column": 1,
1515+
"offset": 180
1516+
},
1517+
"end": {
1518+
"line": 56,
1519+
"column": 3,
1520+
"offset": 202
1521+
}
1522+
}
1523+
}
1524+
],
1525+
"position": {
1526+
"start": {
1527+
"line": 51,
1528+
"column": 1,
1529+
"offset": 180
1530+
},
1531+
"end": {
1532+
"line": 56,
1533+
"column": 3,
1534+
"offset": 202
1535+
}
1536+
}
1537+
},
1538+
{
1539+
"type": "list",
1540+
"ordered": false,
1541+
"start": null,
1542+
"spread": false,
1543+
"children": [
1544+
{
1545+
"type": "listItem",
1546+
"spread": false,
1547+
"checked": null,
1548+
"children": [
1549+
{
1550+
"type": "list",
1551+
"ordered": true,
1552+
"start": 1,
1553+
"spread": true,
1554+
"children": [
1555+
{
1556+
"type": "listItem",
1557+
"spread": false,
1558+
"checked": null,
1559+
"children": [
1560+
{
1561+
"type": "paragraph",
1562+
"children": [
1563+
{
1564+
"type": "text",
1565+
"value": "b",
1566+
"position": {
1567+
"start": {
1568+
"line": 57,
1569+
"column": 6,
1570+
"offset": 208
1571+
},
1572+
"end": {
1573+
"line": 57,
1574+
"column": 7,
1575+
"offset": 209
1576+
}
1577+
}
1578+
}
1579+
],
1580+
"position": {
1581+
"start": {
1582+
"line": 57,
1583+
"column": 6,
1584+
"offset": 208
1585+
},
1586+
"end": {
1587+
"line": 57,
1588+
"column": 7,
1589+
"offset": 209
1590+
}
1591+
}
1592+
}
1593+
],
1594+
"position": {
1595+
"start": {
1596+
"line": 57,
1597+
"column": 3,
1598+
"offset": 205
1599+
},
1600+
"end": {
1601+
"line": 57,
1602+
"column": 7,
1603+
"offset": 209
1604+
}
1605+
}
1606+
},
1607+
{
1608+
"type": "listItem",
1609+
"spread": false,
1610+
"checked": null,
1611+
"children": [
1612+
{
1613+
"type": "paragraph",
1614+
"children": [
1615+
{
1616+
"type": "text",
1617+
"value": "c",
1618+
"position": {
1619+
"start": {
1620+
"line": 59,
1621+
"column": 6,
1622+
"offset": 216
1623+
},
1624+
"end": {
1625+
"line": 59,
1626+
"column": 7,
1627+
"offset": 217
1628+
}
1629+
}
1630+
}
1631+
],
1632+
"position": {
1633+
"start": {
1634+
"line": 59,
1635+
"column": 6,
1636+
"offset": 216
1637+
},
1638+
"end": {
1639+
"line": 59,
1640+
"column": 7,
1641+
"offset": 217
1642+
}
1643+
}
1644+
}
1645+
],
1646+
"position": {
1647+
"start": {
1648+
"line": 59,
1649+
"column": 3,
1650+
"offset": 213
1651+
},
1652+
"end": {
1653+
"line": 59,
1654+
"column": 7,
1655+
"offset": 217
1656+
}
1657+
}
1658+
}
1659+
],
1660+
"position": {
1661+
"start": {
1662+
"line": 57,
1663+
"column": 3,
1664+
"offset": 205
1665+
},
1666+
"end": {
1667+
"line": 59,
1668+
"column": 7,
1669+
"offset": 217
1670+
}
1671+
}
1672+
}
1673+
],
1674+
"position": {
1675+
"start": {
1676+
"line": 57,
1677+
"column": 1,
1678+
"offset": 203
1679+
},
1680+
"end": {
1681+
"line": 59,
1682+
"column": 7,
1683+
"offset": 217
1684+
}
1685+
}
1686+
}
1687+
],
1688+
"position": {
1689+
"start": {
1690+
"line": 57,
1691+
"column": 1,
1692+
"offset": 203
1693+
},
1694+
"end": {
1695+
"line": 59,
1696+
"column": 7,
1697+
"offset": 217
1698+
}
1699+
}
13411700
}
13421701
],
13431702
"position": {
@@ -1347,9 +1706,9 @@
13471706
"offset": 0
13481707
},
13491708
"end": {
1350-
"line": 50,
1709+
"line": 60,
13511710
"column": 1,
1352-
"offset": 179
1711+
"offset": 218
13531712
}
13541713
}
13551714
}

0 commit comments

Comments
 (0)