Skip to content

Commit

Permalink
Add html parser for biographies
Browse files Browse the repository at this point in the history
  • Loading branch information
Vokabelsalat committed Oct 19, 2023
1 parent 5909a72 commit f2344dd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/features/biography/biography-viewer.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -25,7 +26,10 @@ export function BiographyViewer(props: BiographyViewerProps): JSX.Element {
return (
<div key={`bio-${biographyId}-${id}`}>
<p className={'text-sm italic'}>{biography.abstract != null && biography.abstract}</p>
<p className={'whitespace-pre-line'}>{biography.text != null && biography.text}</p>
{Boolean(biography.text) && (
//<div>{parse(element!.properties!.text!.value)}</div>
<p className={'whitespace-pre-line'}>{parse(biography.text)}</p>
)}
<p className={'text-xs'}>
{biography.citation != null && `Citation: ${biography.citation}`}
</p>
Expand Down

0 comments on commit f2344dd

Please sign in to comment.