Skip to content

Commit 6b9709e

Browse files
apeirora-service-user[bot]mlenkeit
andcommitted
Release 2.1.5
Co-authored-by: Maximilian Lenkeit <[email protected]>
1 parent 03424fb commit 6b9709e

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

.vitepress/components/Term.vue

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ const getTermName = () => {
1515
return props.name
1616
} else if (defaultSlot && defaultSlot.length > 0) {
1717
// Convert the slot's VNode(s) into plaintext
18-
return defaultSlot.map(vnode => {
18+
const text = defaultSlot.map(vnode => {
1919
// If it's a text vnode
2020
if (typeof vnode.children === 'string') {
2121
return vnode.children
2222
}
2323
return ''
2424
}).join('')
25+
return text
2526
} else {
2627
return null
2728
}
2829
}
2930
3031
onMounted(() => {
3132
const termName = getTermName()
32-
const defaultSlot = slots.default?.()
3333
3434
let term = terms[termName.trim()] || terms[termName.toLowerCase().trim()];
3535
if (!term) {
@@ -47,13 +47,20 @@ onMounted(() => {
4747
termUrl.value = term.url
4848
descriptionText.value = term.description
4949
})
50+
// Note: .term-content shouldn't be a span
51+
// but for some reason, div caused some side-
52+
// effects that did not show up during local
53+
// dev preview; see #163
5054
</script>
55+
5156
<template>
5257
<abbr class="term-wrap">
5358
<a :href="withBase(termUrl)">
54-
{{ termText }}
59+
<slot />
5560
</a>
56-
<div class="term-content">{{ descriptionText }}</div>
61+
<span class="term-content">
62+
{{ descriptionText }}
63+
</span>
5764
</abbr>
5865
</template>
5966

0 commit comments

Comments
 (0)