From f2344dd7d2b4e045c936b72a930f2f386aa54569 Mon Sep 17 00:00:00 2001 From: Jakob Kusnick Date: Thu, 19 Oct 2023 13:58:14 +0200 Subject: [PATCH] Add html parser for biographies --- src/features/biography/biography-viewer.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/features/biography/biography-viewer.tsx b/src/features/biography/biography-viewer.tsx index f639382..39e44da 100644 --- a/src/features/biography/biography-viewer.tsx +++ b/src/features/biography/biography-viewer.tsx @@ -1,5 +1,6 @@ import type { Biography } from '@intavia/api-client'; import { LoadingIndicator } from '@intavia/ui'; +import parse from 'html-react-parser'; import { useId } from 'react'; import { useBiographies } from '@/features/biography/use-biographies'; @@ -25,7 +26,10 @@ export function BiographyViewer(props: BiographyViewerProps): JSX.Element { return (

{biography.abstract != null && biography.abstract}

-

{biography.text != null && biography.text}

+ {Boolean(biography.text) && ( + //
{parse(element!.properties!.text!.value)}
+

{parse(biography.text)}

+ )}

{biography.citation != null && `Citation: ${biography.citation}`}