Skip to content

Commit

Permalink
Merge pull request #11711 from quarto-dev/bugfix/issue-11701
Browse files Browse the repository at this point in the history
wrap HTML emitted by EJS templates in `{=html}` rawblocks
  • Loading branch information
cscheid authored Dec 18, 2024
2 parents 241155a + 38e445d commit 5d6c846
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 3 deletions.
6 changes: 5 additions & 1 deletion news/changelog-1.7.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ All changes included in 1.7:

- ([#11654](https://github.com/quarto-dev/quarto-cli/issues/11654)): Allow `page-inset` as value in `column` key for code cells.

## Book Project
## Website projects

- ([#11701](https://github.com/quarto-dev/quarto-cli/issues/11701)): Wrap HTML emitted by EJS templates in `{=html}` blocks to avoid memory blowup issues with Pandoc's parser.

## Book projects

- ([#11520](https://github.com/quarto-dev/quarto-cli/issues/11520)): Book's cover image now escapes lightbox treatment, which was incorrectly applied to it when `lightbox: true` was set in the book's configuration.

Expand Down
2 changes: 1 addition & 1 deletion src/resources/projects/website/listing/item-default.ejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ print(`<div class="metadata-value listing-${field}">${listing.utilities.outputLi
<% } %>
</div>
<div class="metadata"><a href="<%- item.path %>" class="no-external">
<% if (fields.includes('date') && item.date) { %><div class="listing-date">`<%= item.date %>`{=html}</div><% } %>
<% if (fields.includes('date') && item.date) { %><div class="listing-date"><%= item.date %></div><% } %>
<% if (fields.includes('author') && item.author) { %><div class="listing-author"><%= item.author %></div><% } %>
<% if (fields.includes('reading-time') && item['reading-time']) { %> <div class="listing-reading-time"><%= item['reading-time'] %></div> <% } %>
<% for (const field of otherFields) { %>
Expand Down
2 changes: 1 addition & 1 deletion src/resources/projects/website/listing/item-grid.ejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ const flexJustify = showField('author') && showField('date') ? "justify" : showF
<% if (showField('author') || showField('date')) { %>
<div class="card-attribution card-text-small <%-flexJustify%>">
<% if (showField('author')) { %><div class="listing-author"><%= item.author %></div><% } %>
<% if (showField('date')) { %><div class="listing-date">`<%= item.date %>`{=html}</div><% } %>
<% if (showField('date')) { %><div class="listing-date"><%= item.date %></div><% } %>
</div>
<% } %>

Expand Down
2 changes: 2 additions & 0 deletions src/resources/projects/website/listing/listing-default.ejs.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
:::{.list .quarto-listing-default}
``````{=html}
<% for (const item of items) { %>
<% partial('item-default.ejs.md', {listing, item, utils }) %>
<% } %>
``````
:::
2 changes: 2 additions & 0 deletions src/resources/projects/website/listing/listing-grid.ejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ const cols = listing['grid-columns'];
%>

:::{.list .grid .quarto-listing-cols-<%=cols%>}
```{=html}
<% for (const item of items) { %>
<% partial('item-grid.ejs.md', {listing, item, utils }) %>
<% } %>
```
:::
2 changes: 2 additions & 0 deletions src/resources/projects/website/listing/listing-table.ejs.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ return listing.utilities.outputLink(item, field, value, `listing-${field}`);
}
%>

```{=html}
<table class="quarto-listing-table table<%- stripedCls %><%- hoverCls %>">
<thead>
<tr>
Expand All @@ -90,3 +91,4 @@ return listing.utilities.outputLink(item, field, value, `listing-${field}`);
<% } %>
</tbody>
</table>
```

0 comments on commit 5d6c846

Please sign in to comment.