From 7cc6357a5f8bb7ca2167976ddd53ce323d2cffb9 Mon Sep 17 00:00:00 2001 From: hazycora Date: Wed, 2 Aug 2023 19:36:37 -0500 Subject: [PATCH] update issue template to span paragraphs --- views/issue.eta | 15 +++++++-------- views/spanwords.eta | 5 +++++ 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 views/spanwords.eta diff --git a/views/issue.eta b/views/issue.eta index 6d192c0..4ff881c 100644 --- a/views/issue.eta +++ b/views/issue.eta @@ -1,19 +1,18 @@ <% layout('layout') %> <% - const issueTitleWords = it.issue.title.split(/\s/) - // satori, the HTML-to-SVG engine we use, has no concept of "inline" or "inline-block" - // CSS display values. So, we must emulate them with flex-wrap and making each word a ... + let body = it.issue.body + const bodyCharLimit = 50 + if (body.length > bodyCharLimit) { + body = body.slice(0, bodyCharLimit) + '...' + } %>

@<%= it.issue.repository?.full_name || it.issue.base.repo.full_name %>

-

#<%= it.issue.number %> <% - for (const word of issueTitleWords) { %> - <%= word %> - <% }%>

+

#<%= it.issue.number %><%~ include('spanwords', {text: it.issue.title}) %>

<% if (it.issue.body) { %> -

<%= it.issue.body %>

+

<%~ include('spanwords', {text: body}) %>

<% } %>
diff --git a/views/spanwords.eta b/views/spanwords.eta new file mode 100644 index 0000000..934606f --- /dev/null +++ b/views/spanwords.eta @@ -0,0 +1,5 @@ +<% /* + satori, the HTML-to-SVG engine we use, has no concept of "inline" or "inline-block" + CSS display values. So, we must emulate them with flex-wrap and making each word a ... +*/ %> +<% for (const word of it.text.split(/\s+/)) { %><%= word %><% } %> \ No newline at end of file