File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import { computed } from "vue"
7
7
const props = defineProps ({ overrideLang: String , overrideLangClass: String , ... defineNotionProps })
8
8
// @ts-ignore
9
9
const { properties } = useNotionBlock (props )
10
-
11
10
const lang = computed (() => {
12
11
return props .overrideLang || properties .value ?.language ?.[0 ]?.[0 ]?.toLowerCase ()
13
12
})
@@ -19,6 +18,8 @@ const langClass = computed(() => {
19
18
const supported = computed (() => {
20
19
return lang .value ? Prism ?.languages [lang .value ] : false
21
20
})
21
+
22
+ const computedSlot = computed (() => properties .value ?.title .map ((i ) => i ?.[0 ]).join (" " ))
22
23
</script >
23
24
24
25
<script lang="ts">
@@ -29,9 +30,9 @@ export default {
29
30
30
31
<template >
31
32
<div v-if =" supported" :class =" ['notion-code']" >
32
- <PrismBlock :language =" lang" >{{ properties?.title[0][0] }}</PrismBlock >
33
+ <PrismBlock :language =" lang" >{{ computedSlot }}</PrismBlock >
33
34
</div >
34
35
<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 >
36
37
</div >
37
38
</template >
You can’t perform that action at this time.
0 commit comments