Skip to content

Commit

Permalink
fix: resource description markdown (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
chosww authored Jun 7, 2024
1 parent 3f5d00f commit 53cdba6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/assets/scripts/_resources-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -269,7 +271,12 @@ export function renderResources(resources, resourceTopics, resourceTypes) { // e
resourcesHtml += `
</div>
<div class='card-description'>
<p>${escapeSpecialCharactersForHTML(resource.description)}</p>
<p>${markdownFilter(
escapeSpecialCharactersForHTML(resource.description), {
html: true,
linkify: true,
typographer: true
}, [])}</p>
</div>
${resource.publishedYear ? `<div class="card-publishedYear"><p>Published in ${escapeSpecialCharactersForHTML(resource.publishedYear)}</p></div>` : ""}
<div class='card-link'><a rel='external' href='${resource.link}'>Visit ${escapeSpecialCharactersForHTML(resource.title)}${resourceLink.host === hostURL ? "" : "<svg role='presentation'><use xlink:href='#external' /></svg>"}</a></div>
Expand Down

0 comments on commit 53cdba6

Please sign in to comment.