Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

Feature Request: Allow image links to be treated differently than hyperlinks for --links option #46

Open
acidus99 opened this issue Jan 6, 2023 · 2 comments

Comments

@acidus99
Copy link

acidus99 commented Jan 6, 2023

I can appreciate the challenges of converting hyperlinks in Markdown to gemtext, and I think the --links options cover most use-cases.

However image links are different. They are also semantically different, linking content that should be shown with the markdown document, while a hyperlink is taking about navigating to another piece of content.. They are often used as block level elements, instead of inline in a paragraph, which makes their conversion to a gemtext link line straightforward.

As such, it would be helpful to have a way for image links to be converted differently than hyperlinks.

I propose 2 different options:

  1. Consider treating image links and hyperlinks completely separately. --links would only control how hyperlinks using [text](url) are converted, not images. A different command line switch like --image-links would only control how image links using ![alt text](url) are converted, and would have the same option values that --links has.

  2. Consider adding an "images-only" option to --links that would only convert image links to gemtext link lines.

Option 1 is probably the better long term option. You could have separate defaults, and it allows for more control. However it is more involved. Option 2 is easier, but it still conflates image links with hyperlinks, and does not address more edge case options (like wanting no hyperlinks to be converted, and image links to be converted to footnotes at the end of the gemtext).

@acidus99
Copy link
Author

acidus99 commented Jan 6, 2023

as a bonus, this might help you resolve: #24

@acidus99
Copy link
Author

I opened PR47 which implements option 2:

#47

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

No branches or pull requests

1 participant