Skip to content

Commit

Permalink
No need to check the length here
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmw committed Jan 21, 2020
1 parent 7832ad6 commit 661f514
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions src/components/DefaultEpic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,15 @@ const Highlighted: React.FC<HighlightedProps> = ({ highlighted }: HighlightedPro

const EpicBody: React.FC<BodyProps> = ({ highlighted, paragraphs }: BodyProps) => (
<>
{paragraphs.length > 0 &&
paragraphs.map((paragraph, idx) => (
<p key={idx} className={bodyStyles}>
<span dangerouslySetInnerHTML={{ __html: replacePlaceholders(paragraph) }} />

{highlighted.length > 0 && idx === paragraphs.length - 1 && (
<Highlighted highlighted={highlighted} />
)}
</p>
))}
{paragraphs.map((paragraph, idx) => (
<p key={idx} className={bodyStyles}>
<span dangerouslySetInnerHTML={{ __html: replacePlaceholders(paragraph) }} />

{highlighted.length > 0 && idx === paragraphs.length - 1 && (
<Highlighted highlighted={highlighted} />
)}
</p>
))}
</>
);

Expand Down

0 comments on commit 661f514

Please sign in to comment.