Skip to content
Merged
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
3 changes: 2 additions & 1 deletion packages/visx-demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-github-button": "^0.1.10",
"react-markdown": "^4.3.1",
"react-markdown": "^9.0.1",
"rehype-raw": "^7.0.0",
"topojson-client": "^3.0.0"
},
"publishConfig": {
Expand Down
16 changes: 8 additions & 8 deletions packages/visx-demo/src/components/ApiTable.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useMemo } from 'react';
import Markdown from 'react-markdown/with-html';
import Markdown from 'react-markdown';
import type { DocGenInfo, PropInfo, ParamInfo } from '../types';
import { toExportName } from './util/format';
import { getGitHubUrl } from '../utils/getGitHubUrl';
Expand Down Expand Up @@ -58,7 +58,7 @@ export default function ApiTable({ docgenInfo }: Props) {
</h3>
{description && (
<div className="doc-description">
<Markdown source={description} />
<Markdown>{description}</Markdown>
</div>
)}
{isFunction && parameters && parameters.length > 0 ? (
Expand All @@ -82,13 +82,13 @@ export default function ApiTable({ docgenInfo }: Props) {
)}
</div>
<div className="description">
<Markdown
source={`${param.description || ''}${
<Markdown>
{`${param.description || ''}${
param.defaultValue
? `\n\nDefault \`${String(param.defaultValue.value) || '""'}\``
: ''
}`}
/>
</Markdown>
</div>
</div>
);
Expand Down Expand Up @@ -119,13 +119,13 @@ export default function ApiTable({ docgenInfo }: Props) {
{prop.required && <span className="kind-badge required">required</span>}
</div>
<div className="description">
<Markdown
source={`${prop.description}${
<Markdown>
{`${prop.description}${
prop.defaultValue
? `\n\nDefault \`${String(prop.defaultValue.value) || '""'}\``
: ''
}`}
/>
</Markdown>
</div>
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions packages/visx-demo/src/components/DocPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-underscore-dangle */
import React from 'react';
import Markdown from 'react-markdown/with-html';
import Markdown from 'react-markdown';
import rehypeRaw from 'rehype-raw';

import ApiTable from './ApiTable';
import PackageList from './PackageList';
Expand All @@ -24,7 +25,7 @@ export default function DocPage({ components, examples, visxPackage, readme }: P
</div>
<div className="doc-content">
<div className="doc-readme">
<Markdown escapeHtml={false} source={readme} />
<Markdown rehypePlugins={[rehypeRaw]}>{readme}</Markdown>
</div>
{examples && examples.length > 0 && (
<>
Expand Down
Loading