Skip to content

Commit

Permalink
FIX: Remove trailing whitespace from Markdown lines before rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Feb 26, 2024
1 parent a5269a4 commit f195027
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/openneuro-app/src/scripts/utils/markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,9 +159,11 @@ export function Markdown({ children }: MarkdownProps) {
ALLOWED_ATTR,
ALLOW_ARIA_ATTR: false,
})
/* Work around MarkdownToJsx inefficiency */
const trimmed = sanitizedMarkdown.replace(/ +$/gm, '')
return (
<>
<MarkdownToJsx>{sanitizedMarkdown}</MarkdownToJsx>
<MarkdownToJsx>{trimmed}</MarkdownToJsx>
</>
)
}

0 comments on commit f195027

Please sign in to comment.