plugin style fix

This commit is contained in:
Jan Prochazka 2022-02-07 21:09:33 +01:00
parent 99d59a140c
commit e14e55fd94
2 changed files with 18 additions and 2 deletions

View File

@ -30,7 +30,7 @@
{/if}
</div>
<div>
{packageManifest.description}
{(packageManifest.description?.indexOf('[![') >= 0 ? null : packageManifest.description) || '(No description)'}
</div>
<div class="bold">
{extractPluginAuthor(packageManifest)}

View File

@ -21,5 +21,21 @@ export function extractPluginIcon(packageManifest) {
}
export function extractPluginAuthor(packageManifest) {
return _.isPlainObject(packageManifest.author) ? packageManifest.author.name : packageManifest.author;
if (_.isPlainObject(packageManifest.author) && packageManifest.author.name) {
return packageManifest.author.name;
}
if (packageManifest.author) {
return packageManifest.author;
}
if (_.isPlainObject(packageManifest.publisher) && packageManifest.publisher.username) {
return packageManifest.publisher.username;
}
if (
packageManifest.maintainers &&
_.isPlainObject(packageManifest.maintainers[0]) &&
packageManifest.maintainers[0].username
) {
return packageManifest.maintainers[0].username;
}
return '(Unknown author)';
}