forked from prettier/prettier
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
markdown: Preserve inline code line breaks if --prose-wrap=preserve (p…
- Loading branch information
Showing
5 changed files
with
51 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#### Preserve inline code line breaks if `--prose-wrap=preserve` (#11373 by @andersk) | ||
|
||
<!-- prettier-ignore --> | ||
```markdown | ||
<!-- Input --> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod `tempor | ||
incididunt` ut labore et dolore magna aliqua. | ||
|
||
<!-- Prettier stable --> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod `tempor incididunt` ut labore et dolore magna aliqua. | ||
|
||
<!-- Prettier main --> | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod `tempor | ||
incididunt` ut labore et dolore magna aliqua. | ||
``` |
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
26 changes: 26 additions & 0 deletions
26
tests/format/markdown/prose-wrap-preserve/__snapshots__/jsfmt.spec.js.snap
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,26 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`inline-code-newline.md - {"proseWrap":"preserve"} format 1`] = ` | ||
====================================options===================================== | ||
parsers: ["markdown"] | ||
printWidth: 80 | ||
proseWrap: "preserve" | ||
| printWidth | ||
=====================================input====================================== | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \`tempor | ||
incididunt\` ut labore et dolore magna aliqua. Ut enim ad minim veniam, \`quis | ||
nostrud\` exercitation ullamco laboris nisi ut aliquip ex ea commodo \`consequat. | ||
Duis\` aute irure dolor in reprehenderit in voluptate velit esse cillum dolore \`eu | ||
fugiat\` nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim id est laborum. | ||
=====================================output===================================== | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod \`tempor | ||
incididunt\` ut labore et dolore magna aliqua. Ut enim ad minim veniam, \`quis | ||
nostrud\` exercitation ullamco laboris nisi ut aliquip ex ea commodo \`consequat. | ||
Duis\` aute irure dolor in reprehenderit in voluptate velit esse cillum dolore \`eu | ||
fugiat\` nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim id est laborum. | ||
================================================================================ | ||
`; |
6 changes: 6 additions & 0 deletions
6
tests/format/markdown/prose-wrap-preserve/inline-code-newline.md
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,6 @@ | ||
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod `tempor | ||
incididunt` ut labore et dolore magna aliqua. Ut enim ad minim veniam, `quis | ||
nostrud` exercitation ullamco laboris nisi ut aliquip ex ea commodo `consequat. | ||
Duis` aute irure dolor in reprehenderit in voluptate velit esse cillum dolore `eu | ||
fugiat` nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in | ||
culpa qui officia deserunt mollit anim id est laborum. |
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 @@ | ||
run_spec(__dirname, ["markdown"], { proseWrap: "preserve" }); |