Skip to content

Commit 3ff8bb4

Browse files
committed
Fix attr/enum/class rendering
1 parent 2589e71 commit 3ff8bb4

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

.vitepress/signature.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ function renderFuncBlock(md: MarkdownIt, raw: string, locale?: LocaleConfig, env
563563
}
564564

565565
if (compact) {
566-
const shortHtml = short ? md.renderInline(short) : ''
566+
const shortHtml = short ? md.renderInline(short, env) : ''
567567
const compactDescHtml = description ? md.render(description, env) : ''
568568

569569
let html = '<div class="func-compact">'
@@ -577,7 +577,7 @@ function renderFuncBlock(md: MarkdownIt, raw: string, locale?: LocaleConfig, env
577577
if (compactDescHtml) html += `<div class="func-compact-desc">${compactDescHtml}</div>`
578578

579579
if (params.length > 0) {
580-
const inline = params.map(p => `<code>${escapeHtml(p.name)}</code> -> ${md.renderInline(p.desc)}`).join('; ')
580+
const inline = params.map(p => `<code>${escapeHtml(p.name)}</code> -> ${md.renderInline(p.desc, env)}`).join('; ')
581581
html += `<div class="func-compact-params">${inline}</div>`
582582
}
583583

@@ -598,7 +598,7 @@ function renderFuncBlock(md: MarkdownIt, raw: string, locale?: LocaleConfig, env
598598
}
599599

600600
if (short) {
601-
html += `<p class="func-short">${md.renderInline(short)}</p>\n`
601+
html += `<p class="func-short">${md.renderInline(short, env)}</p>\n`
602602
}
603603

604604
html += '<div class="func-block">\n'
@@ -615,7 +615,7 @@ function renderFuncBlock(md: MarkdownIt, raw: string, locale?: LocaleConfig, env
615615
html += ' <dl class="func-params">\n'
616616
for (const p of params) {
617617
html += ` <dt><code>${escapeHtml(p.name)}</code></dt>\n`
618-
html += ` <dd>${md.renderInline(p.desc)}</dd>\n`
618+
html += ` <dd>${md.renderInline(p.desc, env)}</dd>\n`
619619
}
620620
html += ' </dl>\n'
621621
html += ' </div>\n'
@@ -669,7 +669,7 @@ function renderEnumBlock(md: MarkdownIt, data: EnumRenderData, env?: any): strin
669669
}
670670

671671
if (short) {
672-
html += `<p class="func-short">${md.renderInline(short)}</p>\n`
672+
html += `<p class="func-short">${md.renderInline(short, env)}</p>\n`
673673
}
674674

675675
html += '<div class="func-block">\n'
@@ -690,7 +690,7 @@ function renderEnumBlock(md: MarkdownIt, data: EnumRenderData, env?: any): strin
690690
const caseLabel = escapeHtml(c.name)
691691
const valueHtml = c.value ? ` <span class="enum-case-value">= ${escapeHtml(c.value)}</span>` : ''
692692
html += ` <dt id="${escapeHtml(caseSlug)}"><code>${caseLabel}</code>${valueHtml}</dt>\n`
693-
html += ` <dd>${md.renderInline(c.desc)}</dd>\n`
693+
html += ` <dd>${md.renderInline(c.desc, env)}</dd>\n`
694694
}
695695
html += ' </dl>\n'
696696
html += ' </div>\n'
@@ -703,7 +703,7 @@ function renderEnumBlock(md: MarkdownIt, data: EnumRenderData, env?: any): strin
703703
html += ' <dl class="func-params">\n'
704704
for (const p of params) {
705705
html += ` <dt><code>${escapeHtml(p.name)}</code></dt>\n`
706-
html += ` <dd>${md.renderInline(p.desc)}</dd>\n`
706+
html += ` <dd>${md.renderInline(p.desc, env)}</dd>\n`
707707
}
708708
html += ' </dl>\n'
709709
html += ' </div>\n'
@@ -722,14 +722,14 @@ function renderEnumBlock(md: MarkdownIt, data: EnumRenderData, env?: any): strin
722722
html += ` <code class="func-sig vp-code">${methodSigHtml}</code>\n`
723723

724724
if (m.short) {
725-
html += ` <span class="func-compact-short">${md.renderInline(m.short)}</span>\n`
725+
html += ` <span class="func-compact-short">${md.renderInline(m.short, env)}</span>\n`
726726
}
727727
if (m.description) {
728728
html += ` <div class="func-compact-desc">${md.render(m.description, env)}</div>\n`
729729
}
730730

731731
if (m.params.length > 0) {
732-
const inline = m.params.map(p => `<code>${escapeHtml(p.name)}</code> → ${md.renderInline(p.desc)}`).join('; ')
732+
const inline = m.params.map(p => `<code>${escapeHtml(p.name)}</code> → ${md.renderInline(p.desc, env)}`).join('; ')
733733
html += ` <div class="func-compact-params">${inline}</div>\n`
734734
}
735735

0 commit comments

Comments
 (0)