Skip to content

Commit 3fd6289

Browse files
committed
Merge branch 'main' into git-composable
2 parents 4e250d4 + f11f467 commit 3fd6289

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

plugins/development/plugin-git/src/client/components/GitChangelog.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export const GitChangelog = defineComponent({
3131
const locale = useGitLocaleConfig()
3232
const latestUpdated = useLastUpdated()
3333

34-
const [active, toggle] = useToggle()
34+
const [active, toggleActive] = useToggle()
3535

3636
const ChangelogHeader: FunctionalComponent = () =>
37-
h('div', { class: 'changelog-header', onClick: () => toggle() }, [
37+
h('div', { class: 'changelog-header', onClick: () => toggleActive() }, [
3838
h('div', { class: 'latest-updated' }, [
3939
h('span', { class: 'vpi-changelog' }),
4040
h('span', { 'data-allow-mismatch': '' }, latestUpdated.value!.text),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import type { MarkdownEnv } from 'vuepress/markdown'
2+
3+
export type ClearMarkdownEnv = MarkdownEnv & {
4+
references?: unknown
5+
}
6+
7+
export const cleanMarkdownEnv = (env: ClearMarkdownEnv): ClearMarkdownEnv => ({
8+
filePath: env.filePath,
9+
filePathRelative: env.filePathRelative,
10+
base: env.base,
11+
references: env.references,
12+
})

plugins/markdown/plugin-markdown-hint/src/node/hint.ts

+5-3
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { ensureLeadingSlash } from '@vuepress/helper'
55
import type { PluginWithOptions } from 'markdown-it'
66
import type { MarkdownEnv } from 'vuepress/markdown'
77
import { resolveLocalePath } from 'vuepress/shared'
8+
import { cleanMarkdownEnv } from './cleanMarkdownEnv.js'
89

910
import type { MarkdownHintPluginLocaleData } from './options.js'
1011

@@ -44,7 +45,8 @@ export const hint: PluginWithOptions<MarkdownItHintOptions> = (
4445
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
4546
info = options[localePath]?.[name]
4647
} else {
47-
info = md.renderInline(info, { ...env })
48+
console.log('\nenv: ', env)
49+
info = md.renderInline(info, cleanMarkdownEnv(env))
4850
}
4951

5052
return `<div class="hint-container ${name}">\n<p class="hint-container-title">${info || name}</p>\n`
@@ -71,7 +73,7 @@ export const hint: PluginWithOptions<MarkdownItHintOptions> = (
7173
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
7274
info = options[localePath]?.caution
7375
} else {
74-
info = md.renderInline(info, { ...env })
76+
info = md.renderInline(info, cleanMarkdownEnv(env))
7577
}
7678

7779
return `<div class="hint-container caution">\n<p class="hint-container-title">${
@@ -104,7 +106,7 @@ export const hint: PluginWithOptions<MarkdownItHintOptions> = (
104106
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
105107
info = options[localePath]?.details
106108
} else {
107-
info = md.renderInline(info, { ...env })
109+
info = md.renderInline(info, cleanMarkdownEnv(env))
108110
}
109111

110112
return `<details class="hint-container details"><summary>${

plugins/search/plugin-slimsearch/src/client/components/SearchBox.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ export default defineComponent({
6363
'class': 'slimsearch-button',
6464
'aria-label': locale.value.search,
6565
'onClick': () => {
66-
isActive.value = true
66+
toggleActive(false)
6767
},
6868
},
6969
[

0 commit comments

Comments
 (0)