diff --git a/src/layouts/ReferenceItemLayout.astro b/src/layouts/ReferenceItemLayout.astro index 70d8b63ede..24de63fceb 100644 --- a/src/layouts/ReferenceItemLayout.astro +++ b/src/layouts/ReferenceItemLayout.astro @@ -22,6 +22,7 @@ import { p5Version } from "../globals/p5-version"; import flask from "@src/content/ui/images/icons/flask.svg?raw"; import warning from "@src/content/ui/images/icons/warning.svg?raw"; import _ from 'lodash'; +import { Code } from 'astro:components'; const { entry, relatedEntries } = Astro.props; const currentLocale = getCurrentLocale(Astro.url.pathname); @@ -79,7 +80,7 @@ const relatedReferences = [ const seenParams: Record = {}; const descriptionParts = description.split( - /(
[\s\S]+?<\/code><\/pre>)/gm
+  /(
[\s\S]+?<\/code><\/pre>)/gm
 );
 
 ---
@@ -120,8 +121,8 @@ const descriptionParts = description.split(
           

)} - {descriptionParts.map((part) => { - if (part.startsWith(' { + if (part.startsWith('

')) {
           const exampleCode = _.unescape(part
             .replace(/
/, '')
             .replace(/<\/code><\/pre>/, ''));
@@ -137,6 +138,15 @@ const descriptionParts = description.split(
               includeSound={entry.data.module === 'p5.sound'}
             />
           )
+        } else if (part.startsWith('
')) {
+          const code = _.unescape(part
+            .replace(/
/, '')
+            .replace(/<\/code><\/pre>/, ''));
+          const langMatch = //.exec(part);
+          const lang = langMatch ? langMatch[1] : undefined;
+          return (
+            
+          );
         } else {
           return (