Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(app): Remove trailing whitespace from Markdown lines before rendering #3000

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -516,25 +516,25 @@ Description: Rhyme judgment
3/21/2013: Updated release with QA information
</p>
<p>
This dataset is made available under the Public Domain Dedication and License
v1.0, whose full text can be found at
This dataset is made available under the Public Domain Dedication and License
v1.0, whose full text can be found at

<a
href="http://www.opendatacommons.org/licenses/pddl/1.0/"
>
http://www.opendatacommons.org/licenses/pddl/1.0/
</a>
.
We hope that all users will follow the ODC Attribution/Share-Alike
.
We hope that all users will follow the ODC Attribution/Share-Alike
Community Norms (
<a
href="http://www.opendatacommons.org/norms/odc-by-sa/"
>
http://www.opendatacommons.org/norms/odc-by-sa/
</a>
);
in particular, while not legally required, we hope that all users
of the data will acknowledge the OpenfMRI project and NSF Grant
);
in particular, while not legally required, we hope that all users
of the data will acknowledge the OpenfMRI project and NSF Grant
OCI-1131441 (R. Poldrack, PI) in any publications.
</p>
</div>
Expand Down
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>
</>
)
}
Loading