Skip to content

Commit c4df725

Browse files
committed
fix: invalid Code not showing all content
1 parent 65ce448 commit c4df725

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/blocks/code.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { computed } from "vue"
77
const props = defineProps({ overrideLang: String, overrideLangClass: String, ...defineNotionProps })
88
//@ts-ignore
99
const { properties } = useNotionBlock(props)
10-
1110
const lang = computed(() => {
1211
return props.overrideLang || properties.value?.language?.[0]?.[0]?.toLowerCase()
1312
})
@@ -19,6 +18,8 @@ const langClass = computed(() => {
1918
const supported = computed(() => {
2019
return lang.value ? Prism?.languages[lang.value] : false
2120
})
21+
22+
const computedSlot = computed(() => properties.value?.title.map((i) => i?.[0]).join(""))
2223
</script>
2324

2425
<script lang="ts">
@@ -29,9 +30,9 @@ export default {
2930

3031
<template>
3132
<div v-if="supported" :class="['notion-code']">
32-
<PrismBlock :language="lang">{{ properties?.title[0][0] }}</PrismBlock>
33+
<PrismBlock :language="lang">{{ computedSlot }}</PrismBlock>
3334
</div>
3435
<div v-else :class="['notion-code']">
35-
<pre><code :class="langClass">{{ properties?.title[0][0] }}</code></pre>
36+
<pre><div :class="langClass">{{ computedSlot }}</div></pre>
3637
</div>
3738
</template>

0 commit comments

Comments
 (0)