-
-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix initial, final newlines in fenced code
Closes GH-351.
- Loading branch information
Showing
4 changed files
with
235 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
test/fixtures/input/fenced-code-initial-final-newlines.text
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Initial: | ||
|
||
``` | ||
|
||
|
||
123 | ||
``` | ||
|
||
Final: | ||
|
||
``` | ||
123 | ||
|
||
|
||
``` | ||
|
||
Both: | ||
|
||
``` | ||
|
||
|
||
123 | ||
|
||
|
||
``` |
196 changes: 196 additions & 0 deletions
196
test/fixtures/tree/fenced-code-initial-final-newlines.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,196 @@ | ||
{ | ||
"type": "root", | ||
"children": [ | ||
{ | ||
"type": "paragraph", | ||
"children": [ | ||
{ | ||
"type": "text", | ||
"value": "Initial:", | ||
"position": { | ||
"start": { | ||
"line": 1, | ||
"column": 1, | ||
"offset": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9, | ||
"offset": 8 | ||
}, | ||
"indent": [] | ||
} | ||
} | ||
], | ||
"position": { | ||
"start": { | ||
"line": 1, | ||
"column": 1, | ||
"offset": 0 | ||
}, | ||
"end": { | ||
"line": 1, | ||
"column": 9, | ||
"offset": 8 | ||
}, | ||
"indent": [] | ||
} | ||
}, | ||
{ | ||
"type": "code", | ||
"lang": null, | ||
"meta": null, | ||
"value": "\n\n123", | ||
"position": { | ||
"start": { | ||
"line": 3, | ||
"column": 1, | ||
"offset": 10 | ||
}, | ||
"end": { | ||
"line": 7, | ||
"column": 4, | ||
"offset": 23 | ||
}, | ||
"indent": [ | ||
1, | ||
1, | ||
1, | ||
1 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "paragraph", | ||
"children": [ | ||
{ | ||
"type": "text", | ||
"value": "Final:", | ||
"position": { | ||
"start": { | ||
"line": 9, | ||
"column": 1, | ||
"offset": 25 | ||
}, | ||
"end": { | ||
"line": 9, | ||
"column": 7, | ||
"offset": 31 | ||
}, | ||
"indent": [] | ||
} | ||
} | ||
], | ||
"position": { | ||
"start": { | ||
"line": 9, | ||
"column": 1, | ||
"offset": 25 | ||
}, | ||
"end": { | ||
"line": 9, | ||
"column": 7, | ||
"offset": 31 | ||
}, | ||
"indent": [] | ||
} | ||
}, | ||
{ | ||
"type": "code", | ||
"lang": null, | ||
"meta": null, | ||
"value": "123\n\n", | ||
"position": { | ||
"start": { | ||
"line": 11, | ||
"column": 1, | ||
"offset": 33 | ||
}, | ||
"end": { | ||
"line": 15, | ||
"column": 4, | ||
"offset": 46 | ||
}, | ||
"indent": [ | ||
1, | ||
1, | ||
1, | ||
1 | ||
] | ||
} | ||
}, | ||
{ | ||
"type": "paragraph", | ||
"children": [ | ||
{ | ||
"type": "text", | ||
"value": "Both:", | ||
"position": { | ||
"start": { | ||
"line": 17, | ||
"column": 1, | ||
"offset": 48 | ||
}, | ||
"end": { | ||
"line": 17, | ||
"column": 6, | ||
"offset": 53 | ||
}, | ||
"indent": [] | ||
} | ||
} | ||
], | ||
"position": { | ||
"start": { | ||
"line": 17, | ||
"column": 1, | ||
"offset": 48 | ||
}, | ||
"end": { | ||
"line": 17, | ||
"column": 6, | ||
"offset": 53 | ||
}, | ||
"indent": [] | ||
} | ||
}, | ||
{ | ||
"type": "code", | ||
"lang": null, | ||
"meta": null, | ||
"value": "\n\n123\n\n", | ||
"position": { | ||
"start": { | ||
"line": 19, | ||
"column": 1, | ||
"offset": 55 | ||
}, | ||
"end": { | ||
"line": 25, | ||
"column": 4, | ||
"offset": 70 | ||
}, | ||
"indent": [ | ||
1, | ||
1, | ||
1, | ||
1, | ||
1, | ||
1 | ||
] | ||
} | ||
} | ||
], | ||
"position": { | ||
"start": { | ||
"line": 1, | ||
"column": 1, | ||
"offset": 0 | ||
}, | ||
"end": { | ||
"line": 26, | ||
"column": 1, | ||
"offset": 71 | ||
} | ||
} | ||
} |