-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
"proseWrap: always" breaks markdown links #9232
Comments
It may be easier for me to fix the markdown renderer my company uses, but I'd like to bring up a few points of discussion first:
[link]:
https://my-website.com/this-is-a-really-long-url-that-causes-the-line-to-wrap In this example, the extra newline feels messy to me, and only moves the link left 6 characters. A url that causes wrapping will most likely still go beyond 80 characters. I see the value of this setting when a title is used after the link url. Perhaps a compromise would be to retain the current wrapping behavior when a title is used, but never add a line break when a title is not present, regardless of the I sort of see this being similar to the decision to special case mocha test strings on a single line, even when otherwise the rules would have them break. Regardless of whether markdown renderers support new lines in definitions, I find it more pleasing to the eye to have the definition all on one line, as it makes scanning the definitions list much easier. |
Hi there- are there any plans to address (or discuss) this issue? I'm the author of Restyled, which offers prettier-markdown automation on PRs as one of its "restylers", and I'm probably going to move it to an opt-in status, since it can't be trusted not to break links like this. I'd love to avoid that if this issue had any traction. |
Commenting to express support for this as well -- besides breaking some rendering, I really do not like how it looks. |
Hi there, I was going to make a PR for this, but after reading the |
Have encountered this too. Seems to work for GitHub-flavoured markdown, but was deploying a Jekyll GitHub Pages site and hadn't spotted it had broken that! |
Prettier 2.1.2
Playground link
Input:
Output:
Expected behavior:
I guess this is the currently expected behavior, but it breaks the markdown formatter my company uses - the link renders as a literal
[this link]
, and you can still see the link text at the bottom of the document. Without the newline, the link renders as expected. I'd prefer not to disable proseWrap because I do prefer my markdown to wrap at 80 characters. But I wouldn't necessarily consider the links at the bottom to be a part of the "prose" of the document, so maybe they can be exempt from this setting and always format as one line?The text was updated successfully, but these errors were encountered: