From ffdae57e61bd90828575689446eb080a4d37b24c Mon Sep 17 00:00:00 2001 From: Ugo Baroncini Date: Wed, 16 Apr 2025 19:33:54 +0200 Subject: [PATCH 1/4] Removed default export Signed-off-by: Ugo Baroncini --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index d0fc80e..98aa7ca 100644 --- a/index.js +++ b/index.js @@ -10,6 +10,6 @@ export { MarkdownAsync, MarkdownHooks, - Markdown as default, + Markdown, defaultUrlTransform } from './lib/index.js' From 99b241c41462984a52da3525b4d04ec1609996e8 Mon Sep 17 00:00:00 2001 From: Ugo Baroncini Date: Wed, 16 Apr 2025 19:43:49 +0200 Subject: [PATCH 2/4] Updated readme.md to reflect default export removal Signed-off-by: Ugo Baroncini --- readme.md | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/readme.md b/readme.md index 949b180..f45b312 100644 --- a/readme.md +++ b/readme.md @@ -101,14 +101,14 @@ npm install react-markdown In Deno with [`esm.sh`][esmsh]: ```js -import Markdown from 'https://esm.sh/react-markdown@10' +import { Markdown } from 'https://esm.sh/react-markdown@10' ``` In browsers with [`esm.sh`][esmsh]: ```html ``` @@ -119,7 +119,7 @@ A basic hello world: ```js import React from 'react' import {createRoot} from 'react-dom/client' -import Markdown from 'react-markdown' +import { Markdown } from 'react-markdown' const markdown = '# Hi, *Pluto*!' @@ -145,7 +145,7 @@ URLs directly): ```js import React from 'react' import {createRoot} from 'react-dom/client' -import Markdown from 'react-markdown' +import { Markdown } from 'react-markdown' import remarkGfm from 'remark-gfm' const markdown = `Just a link: www.nasa.gov.` @@ -173,7 +173,6 @@ This package exports the identifiers [`MarkdownHooks`][api-markdown-hooks], and [`defaultUrlTransform`][api-default-url-transform]. -The default export is [`Markdown`][api-markdown]. It also exports the additional [TypeScript][] types [`AllowElement`][api-allow-element], @@ -375,7 +374,7 @@ which adds support for strikethrough, tables, tasklists and URLs directly: ```js import React from 'react' import {createRoot} from 'react-dom/client' -import Markdown from 'react-markdown' +import { Markdown } from 'react-markdown' import remarkGfm from 'remark-gfm' const markdown = `A paragraph with *emphasis* and **strong importance**. @@ -445,7 +444,7 @@ strikethrough: ```js import React from 'react' import {createRoot} from 'react-dom/client' -import Markdown from 'react-markdown' +import { Markdown } from 'react-markdown' import remarkGfm from 'remark-gfm' const markdown = 'This ~is not~ strikethrough, but ~~this is~~!' @@ -481,7 +480,7 @@ In this case, we apply syntax highlighting with the seriously super amazing ```js import React from 'react' import {createRoot} from 'react-dom/client' -import Markdown from 'react-markdown' +import { Markdown } from 'react-markdown' import {Prism as SyntaxHighlighter} from 'react-syntax-highlighter' import {dark} from 'react-syntax-highlighter/dist/esm/styles/prism' @@ -543,7 +542,7 @@ is used to support math in markdown, and a transform plugin ```js import React from 'react' import {createRoot} from 'react-dom/client' -import Markdown from 'react-markdown' +import { Markdown } from 'react-markdown' import rehypeKatex from 'rehype-katex' import remarkMath from 'remark-math' import 'katex/dist/katex.min.css' // `rehype-katex` does not import the CSS for you @@ -661,7 +660,7 @@ can spare the bundle size (±60kb minzipped), then you can use ```js import React from 'react' import {createRoot} from 'react-dom/client' -import Markdown from 'react-markdown' +import { Markdown } from 'react-markdown' import rehypeRaw from 'rehype-raw' const markdown = `
From 4f125b361e42ac27b2061ef444a39be329c535da Mon Sep 17 00:00:00 2001 From: Ugo Baroncini Date: Wed, 16 Apr 2025 19:49:47 +0200 Subject: [PATCH 3/4] Update test.jsx to reflect removed default export Signed-off-by: Ugo Baroncini --- test.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test.jsx b/test.jsx index 1b254db..4d8c716 100644 --- a/test.jsx +++ b/test.jsx @@ -24,7 +24,7 @@ import {render, waitFor} from '@testing-library/react' import concatStream from 'concat-stream' import {Component} from 'react' import {renderToPipeableStream, renderToStaticMarkup} from 'react-dom/server' -import Markdown, {MarkdownAsync, MarkdownHooks} from 'react-markdown' +import {Markdown, MarkdownAsync, MarkdownHooks} from 'react-markdown' import rehypeRaw from 'rehype-raw' import rehypeStarryNight from 'rehype-starry-night' import remarkGfm from 'remark-gfm' From ea332edd65b6bb165be13479ef7cf39ff5c9545d Mon Sep 17 00:00:00 2001 From: Ugo Baroncini Date: Wed, 16 Apr 2025 19:57:03 +0200 Subject: [PATCH 4/4] Fix readme.md Missing `Markdown` component reference Signed-off-by: Ugo Baroncini --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index f45b312..4fceca2 100644 --- a/readme.md +++ b/readme.md @@ -169,6 +169,7 @@ createRoot(document.body).render( ## API This package exports the identifiers +[`Markdown`][api-markdown], [`MarkdownAsync`][api-markdown-async], [`MarkdownHooks`][api-markdown-hooks], and