Skip to content

Wrap Text in Links #521

@hannob

Description

@hannob

Context

It appears mdformat never adds line breaks within a link description. This can lead to excessively long lines.

Example:

[This is a very extremely absolutely excessively long extra long sentence with a link in it](https://example.com/).

mdformat --wrap 80 does not change this input at all. I would expect an output like this:

[This is a very extremely absolutely excessively long extra long sentence with a
link in it](https://example.com/).

It appears to be allowed by the commonmark spec to have newlines in the link text, see the example here:
https://spec.commonmark.org/0.31.2/#example-541

Proposal

The wrap functionality should also wrap text inside a link text.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions