rehypejs/rehype-external-links

Add option to include relative links

vlad-zhukov opened this issue · 4 comments

Initial checklist

Problem

I'd like to use this plugin to add target and rel properties to links with relative urls. Currently only absolute urls are supported.

Solution

I suggest the test option to be responsible for that. By default it filters links with absolute urls, and you can override it. This is a breaking change.

Alternatives

  • Add a new option includeRelative
  • Remove filtering completely
wooorm commented

Your use case sounds unrelated to this project. This project is explicitly called “external links”, and is about making them safe.
What rels and target do you want to add?
I’d probably recommend to make your own plugin. That’s what our entire ecosystem is about: that you can write plugins to do anything. You likely don’t need much of the logic here. You’ll have simpler code, a smaller bundler, and better performance

I just want certain links to open in a new tab. My own plugin might be a better option here. Thanks!

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

Hi! Thanks for reaching out! Because we treat issues as our backlog, we close issues that are questions since they don’t represent a task to be completed.

See our support docs for how and where to ask questions.

Thanks,
— bb