Merge pull request #10311 from alexgleason/fix-undefined-title

Fix "Cannot read properties of undefined (reading 'startsWith')"
This commit is contained in:
Timothy Jaeryang Baek 2025-02-18 19:29:42 -08:00 committed by GitHub
commit 0b271d24d1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,7 +2,7 @@
export let token;
export let onClick: Function = () => {};
let attributes: Record<string, string> = {};
let attributes: Record<string, string | undefined> = {};
function extractAttributes(input: string): Record<string, string> {
const regex = /(\w+)="([^"]*)"/g;
@ -42,6 +42,6 @@
}}
>
<span class="line-clamp-1">
{formattedTitle(attributes.title)}
{attributes.title ? formattedTitle(attributes.title) : ''}
</span>
</button>