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

Long inline links reflowing is problematic #64

Open
gsliepen opened this issue May 28, 2022 · 4 comments
Open

Long inline links reflowing is problematic #64

gsliepen opened this issue May 28, 2022 · 4 comments

Comments

@gsliepen
Copy link

If an inline link is too long, it might get reflowed in a suboptimal way. It happens when you have a line that looks like:

Some text with [a link](https://example.org/some-very-looooooooooooooooooooooooooooooooooooooooooooooooooong-link.html)

This gets reflowed like so:

Some text with [a link](
https://example.org/some-very-looooooooooooooooooooooooooooooooooooooooooooooooooong-link.html)

Some Markdown converters (like libtext-markdown-perl) don't like this, and will generate this HTML:

<p>Some text with [a link](
https://example.org/some-very-looooooooooooooooooooooooooooooooooooooooooooooooooong-link.html)</p>

I think the way it is reflowed is valid CommonMark, but it would be nicer for some tools, and arguably as well for a human reader, if the above example would be reflowed as:

Some text with
[a link](https://example.org/some-very-looooooooooooooooooooooooooooooooooooooooooooooooooong-link.html)
@jmholla
Copy link
Contributor

jmholla commented Nov 21, 2022

Sorry it's taken me so long to take a look at this. I think this is a fine request. My initial choice was designed to make the text more justified, but this is extremely reasonable. I'll get a new version out with this change in the not too distant future.

@jmholla
Copy link
Contributor

jmholla commented Nov 22, 2022

A followup question, would reformatting that to this also work for your use case:

Some text with [a
link](https://example.org/some-very-looooooooooooooooooooooooooooooooooooooooooooooooooong-link.html)

or is it important that the link text be on one line?

Thanks!

@gsliepen
Copy link
Author

libtext-markdown-perl thinks that is OK. It seems the requirement is that ](https://the.whole.url/) is on one line.

@mnil
Copy link

mnil commented Sep 27, 2023

This is also causing issues for doxygen links to subsections

Loooooooooooooooooooooong [labore](
#lorem_ipsum) et dolore magna aliqua.

which with markflow 0.2.1 will get formatted as

Loooooooooooooooooooooong [labore](
# lorem_ipsum) et dolore magna aliqua.

which will not work. I think it would be better to better to keep ](#lorem_ipsum) on the same line.

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

3 participants