Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Configuring the base as a CDN address will cause a hyperlink href exception #3132

Closed
4 tasks done
yangdan8 opened this issue Oct 24, 2023 · 1 comment
Closed
4 tasks done
Labels
bug: pending triage Maybe a bug, waiting for confirmation

Comments

@yangdan8
Copy link

yangdan8 commented Oct 24, 2023

Describe the bug

Configuring the base as a CDN address will cause a hyperlink href exception

<a  class="title"
  href="http:/abc.cdn.cn/hello/"
  data-v-b817187b>
  <!--[--><!--]--><!----><!--[-->VitePress<!--]--><!--[--><!--]-->
</a>

Reproduction

// config.js

export default ({
    base: 'http://abc.cdn.cn/hello/',
});

// index.md

# hello
![](world.png)

// dist/index.html

...
<header class="VPNav" data-v-30b21250 data-v-04c31db4>
          <div class="VPNavBar" data-v-04c31db4 data-v-d8c1e712>
            <div class="container" data-v-d8c1e712>
              <div class="title" data-v-d8c1e712>
                <div class="VPNavBarTitle" data-v-d8c1e712 data-v-b817187b>
                  <a
                    class="title"
                    href="http:/abc.cdn.cn/hello/"
                    data-v-b817187b
                    ><!--[--><!--]--><!----><!--[-->VitePress<!--]--><!--[--><!--]--></a
                  >
                </div>
              </div>
...

Expected behavior

href="/"
or
href="http://abc.cdn.cn/hello/"

System Info

win11
chrome118
"vitepress": "1.0.0-rc.23"

Additional context

No response

Validations

Please review the following demo:
https://stackblitz.com/edit/github-tyb3oh-fjwkma?file=docs%2F.vitepress%2Fdist%2Findex.html
or
https://github.com/yangdan8/vitepress-bug.git

@yangdan8 yangdan8 added the bug: pending triage Maybe a bug, waiting for confirmation label Oct 24, 2023
@brc-dd
Copy link
Member

brc-dd commented Oct 24, 2023

It's not supported right now.

Duplicate of #736

#2467 will fix this, but it will need major rebase.

@brc-dd brc-dd closed this as completed Oct 24, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug: pending triage Maybe a bug, waiting for confirmation
Projects
None yet
Development

No branches or pull requests

2 participants