diff --git a/apps/readest-app/src/app/library/components/BookItem.tsx b/apps/readest-app/src/app/library/components/BookItem.tsx index 30c0faca..ac278d94 100644 --- a/apps/readest-app/src/app/library/components/BookItem.tsx +++ b/apps/readest-app/src/app/library/components/BookItem.tsx @@ -14,7 +14,7 @@ import { useTranslation } from '@/hooks/useTranslation'; import { useResponsiveSize } from '@/hooks/useResponsiveSize'; import { LibraryCoverFitType, LibraryViewModeType } from '@/types/settings'; import { navigateToLogin } from '@/utils/nav'; -import { formatAuthors } from '@/utils/book'; +import { formatAuthors, formatDescription } from '@/utils/book'; import ReadingProgress from './ReadingProgress'; import BookCover from '@/components/BookCover'; @@ -91,7 +91,7 @@ const BookItem: React.FC = ({ className={clsx( 'flex w-full flex-col p-0', mode === 'grid' && 'pt-2', - mode === 'list' && 'py-2', + mode === 'list' && 'gap-2 py-0', )} >
@@ -110,6 +110,9 @@ const BookItem: React.FC = ({

)}
+

+ {formatDescription(book.metadata?.description)} +

{ return typeof title === 'string' ? title : formatLanguageMap(title); }; +export const formatDescription = (description?: string | LanguageMap) => { + if (!description) return ''; + const text = typeof description === 'string' ? description : formatLanguageMap(description); + return text + .replace(/<\/?[^>]+(>|$)/g, '') + .replace(/&#\d+;/g, '') + .trim(); +}; + export const formatPublisher = (publisher: string | LanguageMap) => { return typeof publisher === 'string' ? publisher : formatLanguageMap(publisher); };