Skip to content

Commit 8c5553e

Browse files
committed
Protect dates from being interpreted as markdown
Fixes #4017
1 parent 4789e5d commit 8c5553e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/resources/projects/website/listing/item-default.ejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ print(`<div class="metadata-value listing-${field}">${listing.utilities.outputLi
5555
<% } %>
5656
</a></div>
5757
<div class="metadata"><a href="<%- item.path %>">
58-
<% if (fields.includes('date') && item.date) { %><div class="listing-date"><%= item.date %></div><% } %>
58+
<% if (fields.includes('date') && item.date) { %><div class="listing-date">`<%= item.date %>`{=html}</div><% } %>
5959
<% if (fields.includes('author') && item.author) { %><div class="listing-author"><%= item.author %></div><% } %>
6060
<% if (fields.includes('reading-time') && item['reading-time']) { %> <div class="listing-reading-time"><%= item['reading-time'] %></div> <% } %>
6161
<% for (const field of otherFields) { %>

src/resources/projects/website/listing/item-grid.ejs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const flexJustify = showField('author') && showField('date') ? "justify" : showF
6565
<% if (showField('author') || showField('date')) { %>
6666
<div class="card-attribution card-text-small <%-flexJustify%>">
6767
<% if (showField('author')) { %><div class="listing-author"><%= item.author %></div><% } %>
68-
<% if (showField('date')) { %><div class="listing-date"><%= item.date %></div><% } %>
68+
<% if (showField('date')) { %><div class="listing-date">`<%= item.date %>`{=html}</div><% } %>
6969
</div>
7070
<% } %>
7171

0 commit comments

Comments
 (0)