Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature request: Support link reference definitions. #15

Closed
NfNitLoop opened this issue Jul 3, 2021 · 5 comments
Closed

Feature request: Support link reference definitions. #15

NfNitLoop opened this issue Jul 3, 2021 · 5 comments

Comments

@NfNitLoop
Copy link

NfNitLoop commented Jul 3, 2021

Instead of creating all links inline, it would help the readability of unrendered Markdown documents if there were an option to move all links to link reference definitions at the end of the document.

Ex:

Here is some text with a [link](https://0bin.net/paste/s735Z5wG#IFueVOPicYrnyDjhxp7NlMcFGG7N6WjYwyz9Lsgdubr) that can become distracting in the middle if plaintext. Especially if there are [multiple](https://www.google.com/) [links](https://www.wikipedia.org/) [close](https://github.com) to each other.

Would be much nicer to read as:

Here is some text with a [link] that can become distracting in the middle if plaintext. Especially if there are [multiple] [links] [close] to each other.

[link]: https://0bin.net/paste/s735Z5wG#IFueVOPicYrnyDjhxp7NlMcFGG7N6WjYwyz9Lsgdubr
[multiple]: https://www.google.com/
[links]: https://www.wikipedia.org/
[close]:  https://github.com

Or even with explicit link references like this, if that's easier to automate:

Here is some text with a [link][1] that can become distracting in the middle if plaintext. Especially if there are [multiple][2] [links][3] [close][4] to each other.

[1]: https://0bin.net/paste/s735Z5wG#IFueVOPicYrnyDjhxp7NlMcFGG7N6WjYwyz9Lsgdubr
[2]: https://www.google.com/
[3]: https://www.wikipedia.org/
[4]: https://github.com

This is a feature I really like in https://pypi.org/project/html2text/, and I see mentioned in https://github.com/mixmark-io/turndown

@nonara
Copy link
Collaborator

nonara commented Jul 7, 2021

Great suggestion! Added to my queue.

@nonara nonara closed this as completed in a7caef1 Jul 11, 2021
@NfNitLoop
Copy link
Author

Thanks! Looking forward to trying this out! 👍 (Though that’ll probably be when the link space issue is fixed, since that’s a blocker for me.)

@nonara
Copy link
Collaborator

nonara commented Jul 11, 2021

Added in v1 via useLinkReferenceDefinitions option.

@nonara
Copy link
Collaborator

nonara commented Jul 11, 2021

@NfNitLoop Sure thing. Working on that.

NfNitLoop added a commit to diskuto/rss-sync that referenced this issue Apr 16, 2022
This was easy thanks to a new feature in node-html-markdown. Thanks! :D
crosstype/node-html-markdown#15
@NfNitLoop
Copy link
Author

Finally got around to using this. Works great, thanks!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants