@@ -5,7 +5,7 @@ import Head from "@components/Head/index.astro";
5
5
import {
6
6
getRefEntryTitleConcatWithParen ,
7
7
escapeCodeTagsContent ,
8
- separateReferenceExamples ,
8
+ parseReferenceExamplesAndMetadata ,
9
9
normalizeReferenceRoute ,
10
10
getRelatedEntriesinCollection ,
11
11
generateJumpToState ,
@@ -22,9 +22,9 @@ import { setJumpToState } from "../globals/state";
22
22
const { entry, relatedEntries } = Astro .props ;
23
23
const currentLocale = getCurrentLocale (Astro .url .pathname );
24
24
25
- const examples = separateReferenceExamples (entry .data .example )
25
+ const examples = parseReferenceExamplesAndMetadata (entry .data .example )
26
26
// Remove empty lines at the beginning and end of the examples
27
- ?.map ((example ) => example . trim ());
27
+ ?.map ((example ) => ({ ... example , src: example . src . trim () } ));
28
28
const description = escapeCodeTagsContent (entry .data .description );
29
29
const t = await getUiTranslator (currentLocale );
30
30
const title = getRefEntryTitleConcatWithParen (entry );
@@ -95,12 +95,12 @@ const seenParams: Record<string, true> = {};
95
95
examples && (
96
96
<div class = " mb-xl" >
97
97
<h2 class = " text-h3" >{ t (" Examples" )} </h2 >
98
- { examples .map ((exampleCode : string , i : number ) => {
98
+ { examples .map (({ src : exampleCode , classes } , i : number ) => {
99
99
return (
100
100
<CodeEmbed
101
101
client :load
102
102
initialValue = { exampleCode }
103
- previewable
103
+ previewable = { ! classes . norender }
104
104
editable
105
105
lazyLoad = { i > 0 }
106
106
previewHeight = " 100px"
0 commit comments