Skip to content
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

lineWidth is ignored, lines are not broken up #103

Open
SuperFluffy opened this issue Mar 21, 2024 · 3 comments
Open

lineWidth is ignored, lines are not broken up #103

SuperFluffy opened this issue Mar 21, 2024 · 3 comments

Comments

@SuperFluffy
Copy link

It seems like the lineWidth setting is completely ignored. Very long lines exceeding it are not broken up, see the playground here: playground

dprint-plugin-markdown version: 0.16.4

Input Code

# Section

The number of characters of this line exceeeds the configured `"lineWidth": 80`. `dprint` should have inserted a newline after the dot, breaking it up.

Expected Output

# Section

The number of characters of this line exceeeds the configured `"lineWidth": 80`.
`dprint` should have inserted a newline after the dot, breaking it up.

Actual Output

# Section

The number of characters of this line exceeeds the configured `"lineWidth": 80`. `dprint` should have inserted a newline after the dot, breaking it up.
@SuperFluffy
Copy link
Author

Thank you so much! How could I have discovered this by myself? Look through pulldown-cmark? Or would this have been documented anywhere on the dprint side?

@SuperFluffy
Copy link
Author

SuperFluffy commented Mar 22, 2024

Alright, I found it on this page: https://dprint.dev/plugins/markdown/config/

It looks like I have no way to configure dprint to 1. insert linebreaks in overflowing lines, while 2. keeping explicit linebreaks intact. See the following examples (the desired behavior at the bottom):

[original]
A very long line exceeding 80 characters. It goes all the way to 80 and stops. Then it goes past it.

A new paragraph.
Here the lines are shorter.
Like so.

[never]
A very long line exceeding 80 characters. It goes all the way to 80 and stops. Then it goes past it.

A new paragraph. Here the lines are shorter. Like so.

[maintain]
A very long line exceeding 80 characters. It goes all the way to 80 and stops. Then it goes past it.

A new paragraph.
Here the lines are shorter.
Like so.

[always]
A very long line exceeding 80 characters. It goes all the way to 80 and stops.
Then it goes past it.

A new paragraph. Here the lines are shorter. Like so.

[desired - maintain explicit newline but insert in overflowing]
A very long line exceeding 80 characters. It goes all the way to 80 and stops.
Then it goes past it.

A new paragraph.
Here the lines are shorter.
Like so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants