Skip to content

Commit 0b7101f

Browse files
rakesh2OO5ksen0
authored andcommitted
Add types for normalizeP5ReferenceLinks helper
1 parent ed6608b commit 0b7101f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/layouts/ReferenceItemLayout.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,14 @@ const descriptionParts = description.split(
9292
9393
// Normalizes malformed p5.* reference anchors (e.g. "#/p5.Element")
9494
// to proper reference routes ("/reference/p5/p5.Element/")
95-
function normalizeP5ReferenceLinks(html) {
95+
function normalizeP5ReferenceLinks(html: string | undefined): string | undefined {
9696
if (!html) return html;
9797
return html.replace(
9898
/href="#\/(p5\.[^"]+)"/g,
9999
'href="/reference/p5/$1/"'
100100
);
101101
}
102+
---
102103

103104
<Head title={entry.data.title} locale={currentLocale} />
104105

0 commit comments

Comments
 (0)