Skip to content

Commit 6f50b5e

Browse files
committed
Fix spread on lists in block quotes
1 parent 3233d8b commit 6f50b5e

File tree

3 files changed

+155
-5
lines changed

3 files changed

+155
-5
lines changed

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,12 @@ function compiler(options) {
286286

287287
tailEvent[1].type = types.lineEnding
288288
lineIndex = tailIndex
289-
} else if (tailEvent[1].type === types.linePrefix) {
289+
} else if (
290+
tailEvent[1].type === types.linePrefix ||
291+
tailEvent[1].type === types.blockQuotePrefix ||
292+
tailEvent[1].type === types.blockQuotePrefixWhitespace ||
293+
tailEvent[1].type === types.blockQuoteMarker
294+
) {
290295
// Empty
291296
} else {
292297
break

test/fixtures/list.json

Lines changed: 144 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,6 +1197,147 @@
11971197
"offset": 163
11981198
}
11991199
}
1200+
},
1201+
{
1202+
"type": "blockquote",
1203+
"children": [
1204+
{
1205+
"type": "list",
1206+
"ordered": false,
1207+
"start": null,
1208+
"spread": true,
1209+
"children": [
1210+
{
1211+
"type": "listItem",
1212+
"spread": false,
1213+
"checked": null,
1214+
"children": [
1215+
{
1216+
"type": "paragraph",
1217+
"children": [
1218+
{
1219+
"type": "text",
1220+
"value": "w",
1221+
"position": {
1222+
"start": {
1223+
"line": 47,
1224+
"column": 5,
1225+
"offset": 169
1226+
},
1227+
"end": {
1228+
"line": 47,
1229+
"column": 6,
1230+
"offset": 170
1231+
}
1232+
}
1233+
}
1234+
],
1235+
"position": {
1236+
"start": {
1237+
"line": 47,
1238+
"column": 5,
1239+
"offset": 169
1240+
},
1241+
"end": {
1242+
"line": 47,
1243+
"column": 6,
1244+
"offset": 170
1245+
}
1246+
}
1247+
}
1248+
],
1249+
"position": {
1250+
"start": {
1251+
"line": 47,
1252+
"column": 3,
1253+
"offset": 167
1254+
},
1255+
"end": {
1256+
"line": 47,
1257+
"column": 6,
1258+
"offset": 170
1259+
}
1260+
}
1261+
},
1262+
{
1263+
"type": "listItem",
1264+
"spread": false,
1265+
"checked": null,
1266+
"children": [
1267+
{
1268+
"type": "paragraph",
1269+
"children": [
1270+
{
1271+
"type": "text",
1272+
"value": "x",
1273+
"position": {
1274+
"start": {
1275+
"line": 49,
1276+
"column": 5,
1277+
"offset": 177
1278+
},
1279+
"end": {
1280+
"line": 49,
1281+
"column": 6,
1282+
"offset": 178
1283+
}
1284+
}
1285+
}
1286+
],
1287+
"position": {
1288+
"start": {
1289+
"line": 49,
1290+
"column": 5,
1291+
"offset": 177
1292+
},
1293+
"end": {
1294+
"line": 49,
1295+
"column": 6,
1296+
"offset": 178
1297+
}
1298+
}
1299+
}
1300+
],
1301+
"position": {
1302+
"start": {
1303+
"line": 49,
1304+
"column": 3,
1305+
"offset": 175
1306+
},
1307+
"end": {
1308+
"line": 49,
1309+
"column": 6,
1310+
"offset": 178
1311+
}
1312+
}
1313+
}
1314+
],
1315+
"position": {
1316+
"start": {
1317+
"line": 47,
1318+
"column": 3,
1319+
"offset": 167
1320+
},
1321+
"end": {
1322+
"line": 49,
1323+
"column": 6,
1324+
"offset": 178
1325+
}
1326+
}
1327+
}
1328+
],
1329+
"position": {
1330+
"start": {
1331+
"line": 47,
1332+
"column": 1,
1333+
"offset": 165
1334+
},
1335+
"end": {
1336+
"line": 49,
1337+
"column": 6,
1338+
"offset": 178
1339+
}
1340+
}
12001341
}
12011342
],
12021343
"position": {
@@ -1206,9 +1347,9 @@
12061347
"offset": 0
12071348
},
12081349
"end": {
1209-
"line": 45,
1210-
"column": 4,
1211-
"offset": 163
1350+
"line": 50,
1351+
"column": 1,
1352+
"offset": 179
12121353
}
12131354
}
12141355
}

test/fixtures/list.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,8 @@
4242
-
4343

4444

45-
- v
45+
- v
46+
47+
> + w
48+
>
49+
> + x

0 commit comments

Comments
 (0)