From 53cdba69344e5df1f98629451650f0abb0c4bd29 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 7 Jun 2024 07:49:11 -0400 Subject: [PATCH] fix: resource description markdown (#929) --- src/assets/scripts/_resources-utils.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/assets/scripts/_resources-utils.js b/src/assets/scripts/_resources-utils.js index b583bdee..533f1d17 100644 --- a/src/assets/scripts/_resources-utils.js +++ b/src/assets/scripts/_resources-utils.js @@ -2,6 +2,8 @@ /* exported filterResources, createPagination */ +import markdownFilter from "eleventy-plugin-fluid/src/filters/markdown-filter.js"; + /* * Filter the data set for records that satisfy one or more of the following criteria, * - at least one topic in the selected topics @@ -269,7 +271,12 @@ export function renderResources(resources, resourceTopics, resourceTypes) { // e resourcesHtml += `
-

${escapeSpecialCharactersForHTML(resource.description)}

+

${markdownFilter( + escapeSpecialCharactersForHTML(resource.description), { + html: true, + linkify: true, + typographer: true + }, [])}

${resource.publishedYear ? `

Published in ${escapeSpecialCharactersForHTML(resource.publishedYear)}

` : ""}