sanyuan0704 / island.js

📝 Vite & MDX powered static site generator. Base on islands architecture

Home Page:https://islandjs.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

feat: support custom `target: _blank` config for link

sanyuan0704 opened this issue · comments

Is your feature request related to a problem? Please describe.

Now Island.js set target: _blank for every external urls (start with http:// or https://), but sometimes we don't want to open a new tab for some links.So we should improve the extensibility of this function.

Describe the solution you'd like

For example, we can expose the config:

{
  markdown: {
    // The link in this list will not open a new window after click
    targetBlankWhiteList: []
  }
}

Now in Island.js,the target: _blank will be attached by rehype-external-links, so we can implement it through it.

Describe alternatives you've considered

No response

Additional context

No response

Validations

  • Read the docs.
  • Read the Contributing Guidelines.
  • Check that there isn't already an issue that asks for the same feature to avoid creating a duplicate.

Is there anyone who want to finish it? Now the targetBlankWhiteList config hasn't exposed to user.

I'm willing to give it a try in my spare time