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

Line wrap at N(=80) characters #36

Open
ahmetb opened this issue Apr 1, 2017 · 2 comments
Open

Line wrap at N(=80) characters #36

ahmetb opened this issue Apr 1, 2017 · 2 comments
Labels

Comments

@ahmetb
Copy link

ahmetb commented Apr 1, 2017

It would be really cool if this was able to line-wrap at 80 characters. A lot of repos require max 80 characters in markdown documentation for ease of maintenance. Many times, line-wrapping tools do not understand markdown and chop the link text or link URI in a damaging way.

It would be nice if we could pass --cols=80 to this command.

@dmitshur
Copy link
Member

dmitshur commented Apr 4, 2017

Hi, thanks for the suggestion.

This is somewhat similar/related to #17, you should check out that issue and the discussion there.

I'll add a thinking label because I want to spend more time thinking this over. But my first impression is that I'm not sure if I want this in scope for this project. I would like markdownfmt to be configuration-free, just like gofmt.

Many times, line-wrapping tools do not understand markdown and chop the link text or link URI in a damaging way.

I was actually thinking that this could be factored out to another tool, but you're right, doing line-wrapping on Markdown can benefit from parsing Markdown. It can still be done by another tool, of course, but it's a signal that it might be a better fit here.

My main argument for why I don't think this should be done is basically this:

I like the current model that doesn't insert newlines at all, and expects your text editor/viewer to render the text with word wrap on. That way, as you resize your text editor/viewer, all text reflows and there's no need to manually edit newline positions.

However, I agree with your point, some repos or other situations require one to manually wrap to some number of columns. I'm just not sure if I want to encourage that.

@dvyukov
Copy link

dvyukov commented Aug 5, 2021

FWIW I would very much want this feature as well. I actually see this as the main thing I would like to get from a markdown formatter.

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

No branches or pull requests

3 participants