music: parse html ents

This commit is contained in:
Cynthia Foxwell 2023-01-23 18:24:28 -07:00
parent a68d11f89b
commit 53181ee4ac
1 changed files with 4 additions and 4 deletions

View File

@ -398,11 +398,11 @@ async function youtubeSearch(msg, str) {
const selection = items.map((item) => ({ const selection = items.map((item) => ({
value: "https://youtu.be/" + item.id.videoId, value: "https://youtu.be/" + item.id.videoId,
key: item.id.videoId, key: item.id.videoId,
display: `${item.snippet.title.substring(0, 99)}${ display: `${parseHtmlEntities(item.snippet.title).substring(0, 99)}${
item.snippet.title.length > 99 ? "…" : "" parseHtmlEntities(item.snippet.title).length > 99 ? "…" : ""
}`, }`,
description: `from ${item.snippet.channelTitle.substring(0, 95)}${ description: `from ${parseHtmlEntities(item.snippet.channelTitle).substring(0, 95)}${
item.snippet.channelTitle.length > 95 ? "…" : "" parseHtmlEntities(item.snippet.channelTitle).length > 95 ? "…" : ""
}`, }`,
})); }));