Skip to content

Commit 09bde42

Browse files
committed
fix: build when no author is provided
1 parent 84d9f8c commit 09bde42

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/lib/markdown.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,17 +123,19 @@ function getMf2Markup(metadata, html) {
123123
let summary = "";
124124
if (metadata.in_reply_to) {
125125
const reply = metadata.in_reply_to;
126-
prefixMarkup += `<p>This post is in reply to a <a class="u-in-reply-to" href="${
126+
prefixMarkup += `<p>This post is in reply to "<a class="u-in-reply-to" href="${
127127
reply.url
128-
}">${reply.name || reply.author.name || reply.url}</a></p>`;
129-
summary += `💬In reply to: ${reply.name || reply.author.name || reply.url}`;
128+
}">${reply.name || reply.author?.name || reply.url}</a>"</p>`;
129+
summary += `💬 In reply to: ${
130+
reply.name || reply.author?.name || reply.url
131+
}`;
130132
}
131133
if (metadata.like_of) {
132134
const like = metadata.like_of;
133135
prefixMarkup += `<p>Liked <a class="u-like-of" href="${like.url}">${
134136
like.name || like.content || like.url
135137
}</a></p>`;
136-
summary += `👍Liked: ${like.name || like.content || like.url}`;
138+
summary += `👍 Liked: ${like.name || like.content || like.url}`;
137139
}
138140
if (metadata.repost_of) {
139141
const repost = metadata.repost_of;
@@ -144,7 +146,7 @@ function getMf2Markup(metadata, html) {
144146
}
145147
if (metadata.rsvp) {
146148
prefixMarkup += `<p>RSVP: <span class="p-rsvp">${metadata.rsvp}</span></p>`;
147-
summary += `💌RSVP: ${metadata.rsvp}`;
149+
summary += `💌 RSVP: ${metadata.rsvp}`;
148150
}
149151
if (metadata.syndication && metadata.syndication.length) {
150152
if (typeof metadata.syndication === "string") {

0 commit comments

Comments
 (0)