* fix(plugin-md-power): incorrect rendering heading from `demo` in `outline`, close #423 * chore: tweak
This commit is contained in:
parent
f81c011e6a
commit
4a39d39331
@ -26,6 +26,7 @@ export async function compileScript(source: string, type: 'ts' | 'js'): Promise<
|
||||
const transform = await compiler.script()
|
||||
const res = await transform(source, {
|
||||
target: 'es2018',
|
||||
platform: 'browser',
|
||||
format: 'cjs',
|
||||
loader: type === 'ts' ? 'ts' : 'js',
|
||||
sourcemap: false,
|
||||
|
||||
@ -72,7 +72,7 @@ export function useHeaders(): Ref<MenuItem[]> {
|
||||
|
||||
export function getHeaders(range?: ThemeOutline): MenuItem[] {
|
||||
const headers = Array.from(
|
||||
document.querySelectorAll('.vp-doc :where(h1,h2,h3,h4,h5,h6)'),
|
||||
document.querySelectorAll('.vp-doc :where(h1,h2,h3,h4,h5,h6):not(.vp-demo-wrapper :where(h1,h2,h3,h4,h5,h6))'),
|
||||
)
|
||||
.filter(el => el.id && el.hasChildNodes())
|
||||
.map((el) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user