From b83b954f32e29735cf65a4c7e35dea13952bc483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Zbytovsk=C3=BD?= Date: Fri, 11 Oct 2024 23:21:05 +0200 Subject: [PATCH] FeaturePanel: add nl2br helper for `description` FeaturedTag (#661) --- src/components/FeaturePanel/FeaturedTag.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/FeaturePanel/FeaturedTag.tsx b/src/components/FeaturePanel/FeaturedTag.tsx index c3332c617..1f2a05a16 100644 --- a/src/components/FeaturePanel/FeaturedTag.tsx +++ b/src/components/FeaturePanel/FeaturedTag.tsx @@ -11,6 +11,7 @@ import { WikidataRenderer } from './renderers/WikidataRenderer'; import { isDesktopResolution } from '../helpers'; import { ClimbingRenderer } from './renderers/ClimbingRenderer'; import { gradeSystemKeys } from './Climbing/utils/grades/gradeSystem'; +import { nl2br } from '../utils/nl2br'; const Wrapper = styled.div` position: relative; @@ -46,7 +47,7 @@ type Renderers = { [key: string]: React.FC<{ k: string; v: string }>; }; -const DefaultRenderer = ({ v }) => v; +const DefaultRenderer = ({ v }) => <>{nl2br(v)}; const climbingRenderers = gradeSystemKeys.reduce( (acc, gradeSystemKey) => ({