Meta: escape chars when generating keywords from tags

A content page contained `"` as a tag, and that caused the meta generator to  produced a malformed page.
This commit is contained in:
infinite-persistence 2022-05-11 14:54:01 +08:00
parent 18ec09c5b0
commit 9f7a163456
No known key found for this signature in database
GPG key ID: B9C3252EDC3D0AA0

View file

@ -217,7 +217,7 @@ function buildClaimOgMetadata(uri, claim, overrideOptions = {}, referrerQuery) {
head += `<meta name="description" content="${cleanDescription}"/>`; head += `<meta name="description" content="${cleanDescription}"/>`;
if (tags && tags.length > 0) { if (tags && tags.length > 0) {
head += `<meta name="keywords" content="${tags.toString()}"/>`; head += `<meta name="keywords" content="${escapeHtmlProperty(tags.toString())}"/>`;
} }
head += `<meta name="twitter:image" content="${claimThumbnail}"/>`; head += `<meta name="twitter:image" content="${claimThumbnail}"/>`;