jekyll-relative-links
jekyll-relative-links copied to clipboard
Handle Line-Wrapped Links
Is your feature request related to a problem? Please describe the problem you're trying to solve.
Currently, if a link is wrapped in valid markdown style (i.e. line break in either text or url section), it is not handled by the relative links plugin.
Describe the solution you'd like
Line wrapped links handled in the same manner as normal links.
Describe alternatives you've considered
Other options include not line-wrapping links (can be painful if the rest of the doc is line-wrapped), or using permalinks to force all to .md (can break if directory structure is generated by outside source).
Additional context
Example:
[my cool link](cool-doc.md)
gets correctly converted to:
[my cool link](cool-doc.html)
But,
[my cool
link](cool-doc.md)
does not get handled and still points to cool-doc.md.
I am happy to do the work to implement this feature, but will likely need some direction :)
@benbalter is this as simple as adding /m option to INLINE_LINK_REGEX (and REFERENCE_LINK_REGEX if we want that also) to enable multi-line mode? https://github.com/benbalter/jekyll-relative-links/blob/c00abd291eb161f9627724c9941d4937c47a9864/lib/jekyll-relative-links/generator.rb#L14
Based on https://spec.commonmark.org/, I don't believe links can have new lines in them. Do you read the spec otherwise?
@benbalter thank you for the quick response :) You can have breaks in an in-line markdown link as long as it does not break the actual link text. Examples: https://gist.github.com/hasheddan/0fcebadaa82f29fd51ab0bcd36d193dd
Gist
GitHub Gist: instantly share code, notes, and snippets.
Some examples with the commonmark tool: https://spec.commonmark.org/dingus/?text=%5Ba%20cool%0Alink%5D(%2Furl)%0A%0A%5Banother%20cool%0Alink%5D(%0A%2Furl)%0A%0A%5B%0Aand%20another%20one%0A%5D(%2Furl)%0A
👍 just ran into this issue when debugging why some links were not handled correctly, but others did, and came to the same conclusion that it was due to those links being wrapped. I would prefer wrapped links to work, as it's quite commonly used.
@benbalter I am happy to make this update 👍 I don't work with Ruby too frequently, any tips on building / testing this project?
@benbalter just following up here :) anything I can do to help?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@benbalter i would love to help get this fixed, any chance we could reopen this?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
still relevant
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
still relevant
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still relevant. Just lost a bunch of hours trying to pin down our issues.