Skip to content

Commit

Permalink
fix(app): Display raw HTML in markdown instead of parsing to JSX
Browse files Browse the repository at this point in the history
  • Loading branch information
nellh committed Jan 24, 2024
1 parent 4c189c8 commit bb875a5
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import Markdown from "markdown-to-jsx"
import React from "react"

export interface MetaDataBlockProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ const DraftContainer: React.FC<DraftContainerProps> = ({ dataset }) => {
description={description.Acknowledgements}
editMode={hasEdit}
>
<Markdown>{description.Acknowledgements || "N/A"}</Markdown>
<Markdown options={{ disableParsingRawHTML: true }}>
{description.Acknowledgements || "N/A"}
</Markdown>
</EditDescriptionField>
)}
/>
Expand All @@ -326,7 +328,9 @@ const DraftContainer: React.FC<DraftContainerProps> = ({ dataset }) => {
description={description.HowToAcknowledge}
editMode={hasEdit}
>
<Markdown>{description.HowToAcknowledge || "N/A"}</Markdown>
<Markdown options={{ disableParsingRawHTML: true }}>
{description.HowToAcknowledge || "N/A"}
</Markdown>
</EditDescriptionField>
)}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ const EditDescriptionList = ({
<ul>
{children.map((item, index) => (
<li key={index}>
<Markdown>{item}</Markdown>
<Markdown options={{ disableParsingRawHTML: true }}>
{item}
</Markdown>
</li>
))}
</ul>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ export const DatasetDefault = ({ dataset, hasEdit }) => (
expandLabel="Read More"
collapseLabel="Collapse"
>
<Markdown>{dataset.draft.readme || "N/A"}</Markdown>
<Markdown options={{ disableParsingRawHTML: true }}>
{dataset.draft.readme || "N/A"}
</Markdown>
</ReadMore>
</EditDescriptionField>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const SnapshotDefault = ({ dataset, snapshot }) => (
heading="README"
item={
<ReadMore id="readme" expandLabel="Read More" collapseLabel="Collapse">
<Markdown>
<Markdown options={{ disableParsingRawHTML: true }}>
{snapshot.readme == null ? "N/A" : snapshot.readme}
</Markdown>
</ReadMore>
Expand Down

0 comments on commit bb875a5

Please sign in to comment.