Skip to content

Commit

Permalink
fix: prose header types
Browse files Browse the repository at this point in the history
Signed-off-by: ZTL-UwU <[email protected]>
  • Loading branch information
ZTL-UwU committed Nov 9, 2024
1 parent ae38bcf commit 53f3ab6
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/content/ProseH1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
const { id } = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => id && headings?.anchorLinks?.h1);
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h1)));
</script>
2 changes: 1 addition & 1 deletion components/content/ProseH2.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
const { id } = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => id && headings?.anchorLinks?.h2);
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h2)));
</script>
2 changes: 1 addition & 1 deletion components/content/ProseH3.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
const { id } = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => id && headings?.anchorLinks?.h3);
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h3)));
</script>
2 changes: 1 addition & 1 deletion components/content/ProseH4.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
const { id } = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => id && headings?.anchorLinks?.h4);
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h4)));
</script>
2 changes: 1 addition & 1 deletion components/content/ProseH5.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
const { id } = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => id && headings?.anchorLinks?.h4);
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h5)));
</script>
2 changes: 1 addition & 1 deletion components/content/ProseH6.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@
const { id } = defineProps<{ id?: string }>();
const { headings } = useRuntimeConfig().public.mdc;
const generate = computed(() => id && headings?.anchorLinks?.h4);
const generate = computed(() => id && ((typeof headings?.anchorLinks === 'boolean' && headings?.anchorLinks === true) || (typeof headings?.anchorLinks === 'object' && headings?.anchorLinks?.h6)));
</script>

0 comments on commit 53f3ab6

Please sign in to comment.