Skip to content

Commit

Permalink
Fix spread on lists in block quotes
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Sep 30, 2020
1 parent 3233d8b commit 6f50b5e
Show file tree
Hide file tree
Showing 3 changed files with 155 additions and 5 deletions.
7 changes: 6 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ function compiler(options) {

tailEvent[1].type = types.lineEnding
lineIndex = tailIndex
} else if (tailEvent[1].type === types.linePrefix) {
} else if (
tailEvent[1].type === types.linePrefix ||
tailEvent[1].type === types.blockQuotePrefix ||
tailEvent[1].type === types.blockQuotePrefixWhitespace ||
tailEvent[1].type === types.blockQuoteMarker
) {
// Empty
} else {
break
Expand Down
147 changes: 144 additions & 3 deletions test/fixtures/list.json
Original file line number Diff line number Diff line change
Expand Up @@ -1197,6 +1197,147 @@
"offset": 163
}
}
},
{
"type": "blockquote",
"children": [
{
"type": "list",
"ordered": false,
"start": null,
"spread": true,
"children": [
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "w",
"position": {
"start": {
"line": 47,
"column": 5,
"offset": 169
},
"end": {
"line": 47,
"column": 6,
"offset": 170
}
}
}
],
"position": {
"start": {
"line": 47,
"column": 5,
"offset": 169
},
"end": {
"line": 47,
"column": 6,
"offset": 170
}
}
}
],
"position": {
"start": {
"line": 47,
"column": 3,
"offset": 167
},
"end": {
"line": 47,
"column": 6,
"offset": 170
}
}
},
{
"type": "listItem",
"spread": false,
"checked": null,
"children": [
{
"type": "paragraph",
"children": [
{
"type": "text",
"value": "x",
"position": {
"start": {
"line": 49,
"column": 5,
"offset": 177
},
"end": {
"line": 49,
"column": 6,
"offset": 178
}
}
}
],
"position": {
"start": {
"line": 49,
"column": 5,
"offset": 177
},
"end": {
"line": 49,
"column": 6,
"offset": 178
}
}
}
],
"position": {
"start": {
"line": 49,
"column": 3,
"offset": 175
},
"end": {
"line": 49,
"column": 6,
"offset": 178
}
}
}
],
"position": {
"start": {
"line": 47,
"column": 3,
"offset": 167
},
"end": {
"line": 49,
"column": 6,
"offset": 178
}
}
}
],
"position": {
"start": {
"line": 47,
"column": 1,
"offset": 165
},
"end": {
"line": 49,
"column": 6,
"offset": 178
}
}
}
],
"position": {
Expand All @@ -1206,9 +1347,9 @@
"offset": 0
},
"end": {
"line": 45,
"column": 4,
"offset": 163
"line": 50,
"column": 1,
"offset": 179
}
}
}
6 changes: 5 additions & 1 deletion test/fixtures/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,8 @@
-


- v
- v

> + w
>
> + x

0 comments on commit 6f50b5e

Please sign in to comment.