Fixed nested template

This commit is contained in:
dangered wolf 2023-08-28 02:23:48 -04:00 committed by GitHub
parent 7cf8856ffe
commit 664fc38ebc
Signed by: DevComp
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,7 +25,10 @@ const generateTweetMedia = (tweet: APITweet): string => {
// eslint-disable-next-line no-case-declarations // eslint-disable-next-line no-case-declarations
const { altText } = mediaItem as APIPhoto; const { altText } = mediaItem as APIPhoto;
// eslint-disable-next-line sonarjs/no-nested-template-literals // eslint-disable-next-line sonarjs/no-nested-template-literals
media += `<img src="${mediaItem.url}" ${altText ? `alt="${altText}"` : ''}/>`; media += `<img src="{url}" {altText}/>`.format({
altText: altText ? `alt="${altText}"` : '',
url: mediaItem.url
});
break; break;
case 'video': case 'video':
media += `<video src="${mediaItem.url}" alt="${tweet.author.name}'s video. Alt text not available."/>`; media += `<video src="${mediaItem.url}" alt="${tweet.author.name}'s video. Alt text not available."/>`;