@@ -35,8 +35,8 @@ const props = defineProps({
3535 * an empty `name` and avoid warnings.
3636 */
3737 required: false ,
38- default: ' '
39- }
38+ default: ' ' ,
39+ },
4040})
4141
4242// Determine the snippet name
@@ -56,15 +56,15 @@ const fetchKey = computed((): string => `portal-snippet-${(snippetName.value ||
5656const { transform, getCachedData } = serveCachedData ()
5757const { data : snippetData, error : snippetError } = await useFetch (' /api/markdown' , {
5858 query: {
59- name: ' snippet'
59+ name: ' snippet' ,
6060 },
6161 // Reuse the same key to avoid re-fetching the document, e.g. `portal-page-about`
6262 key: fetchKey .value ,
6363 dedupe: ' defer' ,
6464 immediate: !! snippetName .value , // Do not immediately fetch in case there's no snippet name
6565 retry: false , // Do not retry on 404 in case the snippet doesn't exist
6666 transform ,
67- getCachedData
67+ getCachedData ,
6868})
6969
7070const nodes = [... snippetParentNodes .value ].join (' |' )
@@ -79,7 +79,8 @@ const removeInvalidSnippets = (obj: Record<string, any>): Record<string, any> |
7979 return obj
8080 .map (item => removeInvalidSnippets (item ))
8181 .filter (item => item !== null )
82- } else if (typeof obj === ' object' && obj !== null ) {
82+ }
83+ else if (typeof obj === ' object' && obj !== null ) {
8384 // Check if the object has 'tag' property and the required 'props.name' condition
8485 if (
8586 obj .tag
@@ -124,15 +125,15 @@ const { data: ast } = await useAsyncData(`parsed-${fetchKey.value}`, async (): P
124125 // Return the MDCParserResult with the sanitized body
125126 return {
126127 ... parsedDoc ,
127- body: processedBody as MDCRoot
128+ body: processedBody as MDCRoot ,
128129 }
129130}, {
130131 // Only parse if there is content and no error. Must be true to allow for async rendering
131132 immediate: !! snippetName .value && (!! sanitizedData && !! snippetData .value ?.content ) && ! snippetError .value , // Do not immediately process the snippet data
132133 dedupe: ' defer' ,
133134 deep: false ,
134135 transform ,
135- getCachedData
136+ getCachedData ,
136137})
137138
138139if (snippetName .value && snippetError .value ) {
0 commit comments