Skip to content

Commit

Permalink
fix(link): opts.title maybe undefined (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
StrivingRabbit authored Nov 26, 2024
1 parent 7e61c24 commit 750a8b2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export function link(
opts?: { title?: string; external?: boolean },
): string {
if (opts?.external) {
return `<a href="${url instanceof URL ? url.href : url}" title="${opts?.title}" target="_blank">${text}</a>`;
return `<a href="${url instanceof URL ? url.href : url}" title="${opts?.title ?? ''}" target="_blank">${text}</a>`;
}

return `[${text || url}](${url || "#"}${opts?.title ? ` "${opts.title}"` : ""})`;
Expand Down

0 comments on commit 750a8b2

Please sign in to comment.