Skip to content

Commit

Permalink
Trim Description Text
Browse files Browse the repository at this point in the history
- Trim newlines/spaces from the description as there are cases where they are present
  • Loading branch information
natyusha authored and harshithmohan committed Oct 4, 2024
1 parent dac40e9 commit e7d402e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/Collection/CleanDescription.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React, { useMemo } from 'react';
import cx from 'classnames';
import { trim } from 'lodash';

import { useSettingsQuery } from '@/core/react-query/settings/queries';

Expand Down Expand Up @@ -69,7 +70,7 @@ const CleanDescription = React.memo(({ altText, className, text }: Props) => {
lines.push(cleanedText.substring(prevPos));
}
LinkRegex.lastIndex = 0;
return lines.join('');
return trim(lines.join(''), '\n ');
}, [text, filterDescription]);

// Fallback to alt text if modified text is empty
Expand Down

0 comments on commit e7d402e

Please sign in to comment.