Skip to content

Commit

Permalink
fix: normalize link skip external url
Browse files Browse the repository at this point in the history
  • Loading branch information
sanyuan0704 committed Sep 24, 2022
1 parent df956f5 commit 7cf22c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/guide/extension.md
Expand Up @@ -34,7 +34,7 @@ export default defineConfig({
});
```

You can see more details in [Config Extension](/api/config-extension#root).
You can see more details in [Config Extension](/api/config-extension#route).

## Markdown

Expand Down
2 changes: 1 addition & 1 deletion docs/guide/spa-mode.md
Expand Up @@ -6,7 +6,7 @@ By default, Island.js will generate a static site for every page and inject part

On the other hand, you can use `SPA` mode to build a single page application. In SPA mode, Island.js will generate a single HTML file and inject all the javascript to make the site interactive. When you click to another page, the browser will not request a new HTML file, but only request a new javascript file to load the new page.

As well as we analyzed before([MPA vs SPA](./spa-vs-mpa)), SPA mode will have better performance and experience in subsequent pages, but with complete hydration and client script in the first page, the first page load performance will be worse than MPA mode.
As well as we analyzed before([MPA vs SPA](/guide/spa-vs-mpa)), SPA mode will have better performance and experience in subsequent pages, but with complete hydration and client script in the first page, the first page load performance will be worse than MPA mode.

## How to use?

Expand Down
3 changes: 3 additions & 0 deletions src/node/plugin-mdx/remarkPlugins/link.ts
Expand Up @@ -18,6 +18,9 @@ export const remarkPluginNormalizeLink: Plugin<
(node: any) => node.type === 'link',
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(node: any) => {
if (node.url.startsWith('http')) {
return;
}
// eslint-disable-next-line prefer-const
let { url, hash } = parseUrl(node.url);
const extname = path.extname(url);
Expand Down

1 comment on commit 7cf22c5

@vercel
Copy link

@vercel vercel bot commented on 7cf22c5 Sep 24, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.