New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(markdown): add proseWrap: "preserve"
option
#3340
feat(markdown): add proseWrap: "preserve"
option
#3340
Conversation
Maybe this should be the default? Currently |
It will be an actual breaking change if we change the default, though the change is to preserve linebreaks, not sure if we should do so. |
@vjeux Thoughts on making this the default? |
I am not a fan of the current default, breaking words to 80 columns for markdown is imo a bad idea. Honestly I think that the best default would be to put everything in one line, but making preserve would be a step in the right direction from my point of view. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might want to update playground as well?
The playground option should be in another PR, tracked in #3338. |
So this basically means prettier won't touch paragraphs all all? If so I'd prefer the default being all in a single line - I expect prettier to normalize stuff not just ignore inconsistencies. I do think this option is a good alternative, but I do think the value proposition of either of the two existing options are higher |
I originally choose I don't have strong preference here. |
My vote goes towards making "preserve" the default. |
if (typeof normalized.proseWrap === "boolean") { | ||
normalized.proseWrap = normalized.proseWrap ? "always" : "never"; | ||
|
||
console.warn( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still use deprecated.js
? It seems to be outdated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems it's only used for useFlowParser
warning.
I think we can refactor those option warnings/redirections using #3352.
LGTM. |
Fixes #3302
Since detecting sentences in different natural languages is hard, preserving original linebreaks should be a good alternative.
Ref: #3302 (comment)