` 태그 안에 래핑됩니다. `
`는 블록 엘리먼트를 내부에 배치할 수 없기 때문에 하이드레이션 불일치가 발생합니다. +커스텀 컴포넌트의 이름에 하이픈이 포함되어 있거나 파스칼케이스(PascalCase)인지 확인하세요. 그렇지 않으면 인라인 요소로 처리되어 `
` 태그 안에 래핑됩니다. `
`는 블록 엘리먼트를 내부에 배치할 수 없기 때문에 하이드레이션 불일치가 발생합니다.
:::
### 헤더에 {{ text }}Demo
diff --git a/docs/zh/guide/getting-started.md b/docs/zh/guide/getting-started.md
index 2d6453c9..2073483a 100644
--- a/docs/zh/guide/getting-started.md
+++ b/docs/zh/guide/getting-started.md
@@ -39,22 +39,6 @@ $ bun add -D vitepress
:::
-::: details 遇到了 missing peer deps 警告?
-如果使用 PNPM,会注意到对 `@docsearch/js` 的 missing peer deps 警告。这不会影响 VitePress 运行。如果希望禁止显示此警告,请将以下内容添加到 `package.json`:
-
-```json
-"pnpm": {
- "peerDependencyRules": {
- "ignoreMissing": [
- "@algolia/client-search",
- "search-insights"
- ]
- }
-}
-```
-
-:::
-
::: tip 注意
VitePress 是仅 ESM 的软件包。不要使用 `require()` 导入它,并确保最新的 `package.json` 包含 `"type": "module"`,或者更改相关文件的文件扩展名,例如 `.vitepress/config.js` 到 `.mjs`/`.mts`。更多详情请参考 [Vite 故障排除指南](http://vitejs.dev/guide/troubleshooting.html#this-package-is-esm-only)。此外,在异步 CJS 上下文中,可以使用 `await import('vitepress')` 代替。
diff --git a/docs/zh/guide/markdown.md b/docs/zh/guide/markdown.md
index 308c49df..a16affbd 100644
--- a/docs/zh/guide/markdown.md
+++ b/docs/zh/guide/markdown.md
@@ -255,7 +255,7 @@ Wraps in a ` tag
if (!parent || !sibling) {
return
}
- const isShell = /language-(shellscript|shell|bash|sh|zsh)/.test(
- parent.className
- )
-
- const ignoredNodes = ['.vp-copy-ignore', '.diff.remove']
+ const isShell = shellRE.test(parent.className)
// Clone the node and remove the ignored nodes
const clone = sibling.cloneNode(true) as HTMLElement
- clone
- .querySelectorAll(ignoredNodes.join(','))
- .forEach((node) => node.remove())
+ clone.querySelectorAll(ignoredNodes).forEach((node) => node.remove())
+ // remove extra newlines left after removing ignored nodes (affecting textContent because it is inside `
`)
+ // doesn't affect the newlines already in the code because they are rendered as `\n`
+ clone.innerHTML = clone.innerHTML.replace(/\n+/g, '\n')
let text = clone.textContent || ''
diff --git a/src/client/app/devtools.ts b/src/client/app/devtools.ts
index 54998fb1..cbc0fd3b 100644
--- a/src/client/app/devtools.ts
+++ b/src/client/app/devtools.ts
@@ -21,8 +21,7 @@ export const setupDevtools = (
componentStateTypes: [COMPONENT_STATE_TYPE]
},
(api) => {
- // TODO: remove any
- api.on.inspectComponent((payload: any) => {
+ api.on.inspectComponent((payload) => {
payload.instanceData.state.push({
type: COMPONENT_STATE_TYPE,
key: 'route',
diff --git a/src/client/app/router.ts b/src/client/app/router.ts
index 7121464c..09d916ec 100644
--- a/src/client/app/router.ts
+++ b/src/client/app/router.ts
@@ -28,6 +28,8 @@ export interface Router {
initialLoad?: boolean
// Whether to smoothly scroll to the target position.
smoothScroll?: boolean
+ // Whether to replace the current history entry.
+ replace?: boolean
}
) => Promise
{{ sponsor.name }}
[props.size, `count-${props.members.length}`])