Fix attachments with empty self-closing tag #224

This commit is contained in:
lowlighter
2021-04-24 21:44:35 +02:00
parent a282b79779
commit a8e4b4652b
2 changed files with 64 additions and 59 deletions

View File

@@ -1,4 +1,5 @@
<% if (account === "user") { %> <% if ((account === "user")&&((base.activity)||(base.community))) { %>
<section>
<div class="row"> <div class="row">
<% if (base.activity) { %> <% if (base.activity) { %>
<section> <section>
@@ -56,4 +57,5 @@
</section> </section>
<% } %> <% } %>
</div> </div>
</section>
<% } %> <% } %>

View File

@@ -28,10 +28,13 @@
<% for (const {text, createdAt, attachments} of plugins.tweets.list) { %> <% for (const {text, createdAt, attachments} of plugins.tweets.list) { %>
<div class="tweet"> <div class="tweet">
<%- text %> <%- text %>
<% if (attachments) { %> <% if (attachments?.length) { %>
<div class="attachments"> <div class="attachments">
<% for (const {image, title, description, website} of attachments) { %> <% for (const {image, title, description, website} of attachments) { %>
<div style="background-image: url('<%= image %>');"> <div style="background-image: url('<%= image %>');">
<span style="display: none;">
Hack to avoid self-closing empty div, do not remove
</span>
<% if (title) { %> <% if (title) { %>
<div class="infos"> <div class="infos">
<div class="title"><%= title %></div> <div class="title"><%= title %></div>