vuepress / core

Vue-Powered Static Site Generator
https://vuepress.vuejs.org
MIT License
2.29k stars 926 forks source link

[Bug report] Customized URL Protocol is not Recongzied #1404

Closed Masterain98 closed 10 months ago

Masterain98 commented 1 year ago

Description

Refer to https://github.com/vuepress-theme-hope/vuepress-theme-hope/issues/3395

In the markdown file, the link field with customized URL protocol will be converted based on the relative path rule instead of considering it as an absolute link.

In the reproduction below, I use the link ms-windows-store://pdp/?ProductId=9PH4NXJ2JN52 in the primary button. When click on it, it redirects to a link that does not exist, instead of pulling up the Windows Store.

Reproduction

https://stackblitz.com/edit/vuepress-5qhpva?file=docs%2FREADME.md

Used Package Manager

npm

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 16.20.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
  Utilities:
    Git: Not Found
  Browsers:
    Chrome: Not Found
  npmPackages:
    @vuepress/bundler-vite:  2.0.0-beta.66 
    @vuepress/bundler-webpack: Not Found
    @vuepress/cli:  2.0.0-beta.66 
    @vuepress/client:  2.0.0-beta.66 
    @vuepress/core:  2.0.0-beta.66 
    @vuepress/markdown:  2.0.0-beta.66 
    @vuepress/plugin-active-header-links:  2.0.0-beta.66 
    @vuepress/plugin-back-to-top:  2.0.0-beta.66 
    @vuepress/plugin-container:  2.0.0-beta.66 
    @vuepress/plugin-docsearch: Not Found
    @vuepress/plugin-external-link-icon:  2.0.0-beta.66 
    @vuepress/plugin-git:  2.0.0-beta.66 
    @vuepress/plugin-google-analytics: Not Found
    @vuepress/plugin-medium-zoom:  2.0.0-beta.66 
    @vuepress/plugin-nprogress:  2.0.0-beta.66 
    @vuepress/plugin-palette:  2.0.0-beta.66 
    @vuepress/plugin-prismjs:  2.0.0-beta.66 
    @vuepress/plugin-pwa: Not Found
    @vuepress/plugin-pwa-popup: Not Found
    @vuepress/plugin-register-components: Not Found
    @vuepress/plugin-search: Not Found
    @vuepress/plugin-shiki: Not Found
    @vuepress/plugin-theme-data:  2.0.0-beta.66 
    @vuepress/plugin-toc: Not Found
    @vuepress/shared:  2.0.0-beta.66 
    @vuepress/theme-default:  2.0.0-beta.66 
    @vuepress/utils:  2.0.0-beta.66 
    vue:  3.3.4 
    vue-loader: Not Found
    vue-router:  4.2.4 
    vuepress: next => 2.0.0-beta.66 
    vuepress-vite:  2.0.0-beta.66 
    vuepress-webpack: Not Found
Mister-Hope commented 1 year ago

@meteorlxy We only handle mail and tel link by isLinkMailto and isLinkTel, I think we do need some support here.

I would suggest removing 2 functions above and add hasProtocal

meteorlxy commented 1 year ago

Good point. PR welcome