npm / markdown-to-jsx
markdown-to-jsx
What changed in markdown-to-jsx 7 to 9, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.
36 breaking6 security2 deprecations34 new APIs and options13 performance9 behavior and defaults1 tooling90 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmarkdown-to-jsx 9182 changes
Breaking changes 34
On tags listed in overrides, a children attribute becomes element text content rather than an output attribute; existing content wins, and void elements, objects, and arrays take none.
The dangerouslySetInnerHTML attribute written in markdown is removed on every tag because it can run script.
Event handlers from markdown are prevented from reaching rendered output. Handlers on capitalized or hyphenated tags remain available on parsed nodes only when the tag is listed in overrides.
The innerHTML attribute written in markdown is removed on every tag because it can run script.
The outerHTML attribute written in markdown is removed on every tag because it can run script.
Capitalized tags match override keys ignoring case, while lowercase tags remain HTML; lowercase overrides receive attributes as written text, and unlisted capitalized tags also receive text attributes.
For raw HTML blocks, parser() returns text with unsafe markup removed; stored or manually built parsed trees no longer write event handlers to HTML or markdown output, except for listed capitalized overrides.
Raw HTML is checked as a browser reads it, preventing markup that parses differently from reaching output with live handlers or links; unsafe or uncheckable markup is removed or shown as text.
The ref attribute written in markdown is removed on every tag because it can run script.
sanitizer() keeps URLs with dangerous-scheme text after the first slash, question mark, or hash, but rejects schemes split by a tab or line break.
The attributeName of SVG animate or set elements is removed when it changes a link or event handler; animations of other attributes are unchanged.
Dangerous tags are escaped by default across React, HTML, Solid, Vue, and React Native outputs; their bodies and closing tags remain visible as inert text.
Heading ids are generated from plain text rather than raw Markdown, so links, formatting markers, and image alt text no longer affect anchors.
Destinations that conceal dangerous schemes with HTML entities are rejected; compilers omit unsafe href or src values, and direct AST rendering re-checks link targets.
Dangerous url(javascript:…) and similar payloads are stripped from HTML and Markdown string outputs.
Dangerous event-handler and URL attributes, srcdoc, and obfuscated unsafe schemes are stripped before output; safe attributes and data:image URLs remain supported.
A reference definition split across blockquote lines is no longer matched by a link using the raw, unnormalized label.
Each React Native styles key is narrowed to the style type accepted by its component, catching mismatched styles at compile time.
HTML block content on its own line without surrounding blank lines is preserved as literal text; content surrounded by blank lines continues to parse markdown.
The text field in HTML AST nodes now contains cleaned inner content without opening or closing tags; use rawText for full raw HTML.
The noInnerParse property has been replaced with verbatim.
HTML blocks are fully parsed into AST children even when verbatim; the flag is now a rendering hint rather than a parsing control.
Arrays, objects, and booleans are parsed into structured values; functions and complex expressions remain strings by default.
The type changed from ReturnType<MarkdownToJSX.NestedParser> to ASTNode[]; update code that uses the old type.
Inline formatting delimiters can no longer span newlines; multi-line emphasis, bold, strikethrough, and mark delimiters render literally.
New name for the former RuleOutput type, including the renderChildren parameter type used by renderRule.
This internal type was removed; code referencing it must be updated.
This internal type was removed; code referencing it must be updated.
This internal type was removed; code referencing it must be updated.
Renamed to MarkdownToJSX.ASTRender; update references to the old type.
This internal type was removed; code referencing it must be updated.
The option was removed; the full HTML entity list is encoded by default, so custom mappings are no longer needed.
Support for React versions below 16 was dropped; the peer dependency requirement is now >= 16.0.0.
Dangerous HTML tags are escaped by default in HTML and React output; set tagfilter to false to disable filtering.
Security 5
HTML output escapes filtered tag names inside comments and attribute values, and escapes ampersands in link targets.
Markdown output escapes or encodes text, code, links, headings, lists, and raw HTML where another renderer could interpret the written text as markup or change its meaning.
Markdown with long runs of brackets or footnote markers now parses in linear time, avoiding severe slowdowns when rendering untrusted input on a server.
Null bytes are replaced with U+FFFD, and a BOM at the start of a document is stripped, improving CommonMark compliance and security.
URLs using javascript:, vbscript:, and malicious data: schemes are protected against.
Deprecations 2
The text property is deprecated and will be removed in a future major version; it remains equal to rawText for backward compatibility.
React code in the main entry point is deprecated; move React-specific usage to markdown-to-jsx/react.
New APIs and options 33
React Native elements can be replaced with custom components via overrides.
Adds a style key for the checkmark glyph of a GFM task item.
Adds styles.footnote to style React Native footnote references, which now render as superscript.
Adds a style key for the checked-box accent of a GFM task item.
Adds a style key for table cell grid lines.
Adds a style key for the bold table header run.
Adds a style key for table row grid lines.
styles.text sets a base font and color for all text at once.
Adds an option to skip frontmatter detection entirely.
Suppresses incomplete markdown syntax during streaming to prevent visual artifacts and flickering.
HTMLNode.rawText exposes the raw text content for verbatim HTML blocks, while children contains the parsed AST.
Opt-in eval evaluates function expressions and other unserializable JSX props; use only with completely trusted markdown sources.
React and React Native expose a context for default options.
Vue exposes an InjectionKey for its provide/inject options pattern.
React, React Native, and Vue provide a MarkdownProvider component to set options once and avoid prop-drilling.
The original raw attribute string is preserved in the rawAttrs field.
Adds SolidJS support with compiler, parser, astToJSX, and a reactive Markdown component using signals/accessors.
Adds Vue.js 3+ support with compiler, parser, astToJSX, and a Markdown component; uses standard HTML attributes with minimal attribute mapping.
Images receive built-in accessibility support through
accessibilityLabel.A new export provides React Native support, including native component mapping, link handling, styling, and component overrides.
TypeScript definitions for native options are available, supporting component overrides with custom React Native components and props.
A type system for native styles is available, with styles for markdown elements and HTML semantic tags.
A callback for native link long presses is available.
A callback for native link presses is available; links default to
Linking.openURL.React Native is an optional peer dependency, so existing users can retain a zero-dependency installation.
Controls whether YAML frontmatter is rendered in React/HTML output or preserved in Markdown-to-Markdown output.
New HTML entry point utility converts parser AST output to HTML.
New React entry point utility converts parser AST output to JSX.
New Markdown entry point utility converts parser AST output to Markdown.
New HTML string output entry point exporting html function, parser, types, and utilities.
New entry point provides Markdown output and AST-based editing without regex-based parsing.
New React-specific entry point exporting compiler, Markdown component, parser, types, and utilities.
New low-level function returns AST nodes and is exported from the main entry point and all sub-entry points.
Performance 12
Deeply nested HTML, repeated pre blocks, long unfinished comments, and text with many unclosed HTML tags no longer cause rendering to slow to tens of seconds or take over a second.
Streaming stays fast on text with many unmatched
[characters.With the option enabled, incomplete-syntax suppression scans only the block that can hold the live edge, reducing repeated work on deeply nested content.
Compiling a large document runs roughly 5–7% quicker, especially for list- and heading-heavy content.
Documents with many bold or italic spans now parse much faster, avoiding sharp slowdowns on very large or adversarial inputs.
Parsing is around 40% faster on large documents, with the biggest gains on link-heavy and code-heavy content.
Markdown with many malformed link starts parses quickly instead of slowing to a crawl on large inputs.
HTML compiler performance improved by about 57%, bringing it to parity with the React compiler.
JSX output bypasses React.createElement by constructing React element objects directly for about 2x faster output; a custom createElement option still falls back to createElement.
Parsing is 27–82% faster depending on input size, and bundle size is reduced by about 25% gzip.
Browser builds use DOM-based entity decoding instead of shipping the full entity lookup table, reducing gzipped bundle size by about 11KB; no configuration is required.
The component no longer re-parses unchanged content when a parent re-renders with unchanged props.
Behavior and default changes 9
Unfinished formatting and markup are held back only in the last paragraph, list item, or quote, where more text can still arrive; earlier blocks render as written.
The option now works in the React Native renderer, suppressing partial structures during streaming.
React Native output now has readable defaults for headings, code, block spacing, blockquotes, tables, and GFM task items; styles remain customizable.
The component accepts
string[]children to support the common JSX case where children arrive as a coalesced array.Task list items now use row and center-aligned defaults so checkboxes and labels sit on the same line; set
styles.listItemto opt out.Attribute casing is preserved by the parser; output adapters handle framework-specific mappings, including JSX prop conversion for React/Native.
Works in both React Server Components and client-side React without use client directives, adapting its behavior to the environment. MarkdownProvider and MarkdownContext become no-ops in RSC environments.
renderRule now runs before other rendering code and controls rendering of normally skipped nodes, including ref, footnote, and frontmatter.
HTML tags map to React Native components:
imgtoImage, block elements toView, and inline elements toText.
Tooling 1
MarkdownToJSX is now declared ambiently, so importing it may not be necessary.
Fixes and other changes 86
evalUnserializableExpressions applies only to a capitalized tag listed in overrides.
Undefined footnote references remain text instead of linking to nothing; streaming references stay unresolved while a definition may still arrive, and reference links with footnotes render as text followed by the footnote reference.
A link reference definition's URL now ends at whitespace even after a backslash, matching CommonMark.
Raw HTML cases that crashed or stopped rendering are handled across React, React Native, Solid, and Vue, including pre content, unfinished pre tags, and processing instructions.
Setting enforceAtxHeadings to false allows headings without a space or tab after the # characters, including in paragraphs, lists, quotes, and inline HTML.
Spaces just inside inline HTML tags are preserved in every output format, with or without optimizeForStreaming.
With this option enabled, finished text—including plain underscores and asterisks, inline code, URLs, links, and raw HTML—renders as it does without the option.
Streaming no longer removes closing HTML tags or elements, drops angle-bracket links, or flashes partial-table pipe characters at the end of a quote.
HTML tag overrides are applied regardless of the casing of the source tag.
Shortcut reference links labeled
__proto__orconstructorno longer throw and resolve like any other reference label.Link destinations preserve punctuation such as underscores while markdown is streamed, preventing generated links from being changed or broken.
Browser bundles no longer crash when reading environment checks because the library no longer imports Node's process module.
PascalCase custom JSX components and hyphenated custom elements retain Markdown children across a blank line, which no longer leaks following content as a sibling.
Headings with identical text receive unique HTML ids; custom slugify still sets the base string, with uniqueness applied afterward.
Rejected image destinations use null in the parsed AST, allowing TypeScript consumers to treat ImageNode.target as string | null.
TypeScript consumers can treat LinkNode.target as string | null, matching rejected link destinations on the parsed AST.
Processing instructions, CDATA sections, declarations, and orphan closing tags are re-emitted exactly as written instead of being reconstructed as generic self-closing elements.
Incomplete HTML is deferred consistently across compilers, including Solid and Vue, while ordinary less-than text continues rendering.
Backslashes before pipes in table cells are escaped when compiling to Markdown, preventing the pipe from splitting the row when reparsed.
Single-line script, style, pre, and textarea blocks preserve their text content when tagfilter is off, including under forceInline.
The last paragraph inside a blockquote no longer leaves extra space below it.
Compiled Markdown better round-trips to the same document, preserving literal characters, table and list structure, code delimiters, titles, raw HTML attributes, and empty inline elements.
Tables remain hidden until enough syntax has streamed to render them, then stay visible as rows arrive, across every renderer.
Footnote references render as superscript instead of bold, and notes in the list appear on one line next to their numbers.
Fixes React key warnings when raw HTML mixes with other content or a custom component follows a heading.
Prevents crashes when text, block elements, or images are mixed; image links remain tappable.
Vue renderRule types now allow a custom rule and its next callback to return arrays of nodes.
URLs containing emoji and other non-BMP Unicode characters render without crashing.
Text on its own line after a nested HTML element now renders when no blank line separates them, consistently across React, React Native, Solid, and Vue outputs.
Fast-skip no longer truncates bare email local-parts containing inline-special characters.
React Native overrides now fire for parsed markdown elements, including inline emphasis, fenced code, headings, lists, and GFM task checkboxes.
Lists, blockquotes, fenced code, and headings inside table cells now render as nested content without breaking surrounding rows or dropping closing tags.
Fixes the Vue adapter warning about a non-function default slot when component overrides are used.
The HTML compiler now preserves closing tags for empty non-void elements.
Frontmatter detection no longer consumes content when a thematic break starts the document; detection now validates YAML key-value syntax.
Markdown lists inside HTML table cells now render as proper nested lists instead of breaking the table structure.
Adds key props to thead and tbody in table rendering to resolve a React key warning.
Void HTML elements no longer drop subsequent content when they are not followed by a newline.
Fixes streaming mode incorrectly stripping self-closing custom component tags and leaking incomplete trailing tags as escaped text in inline content.
Fixes missing TypeScript declaration files in the published package so consumers can use its types.
Tables with only a header row and no data rows no longer render an empty tbody.
Fixes the development warning “Attempted to render without development properties” in React 19 RSC.
Trailing asterisks are trimmed from bare URLs wrapped in bold Markdown so generated link hrefs are correct.
Emphasis delimiters closing before hard line breaks are now resolved correctly.
Raw React elements now unconditionally include
_storeso React dev-mode validation works across bundler environments.Fixed broken exports in bundled output caused by a Bun bundler bug with cross-entry re-exports.
Nested HTML blocks with the same tag name now correctly match depth-paired closing tags.
Ambiguous Setext headings are suppressed during streaming to avoid premature heading rendering.
Raw React elements now include the
_ownerfield expected by React’s reconciler, preventing dev-mode errors in React 19.Void elements preceded by a blank line are returned as content-less blocks, and compilers prevent children from being passed to them, avoiding React error #137.
Raw elements created by the fast path now include
_store: {}in non-production builds, fixing a React dev-mode error when settingvalidated.Fixes incorrect matching of bare email autolinks when DNS labels exceed 63 characters.
HTML entities in link titles now decode correctly; for example,
–becomes–.Content in
<pre>,<script>,<style>, and<textarea>is rendered verbatim instead of being parsed as markdown.GFM alert blockquote syntax is now accepted case-insensitively, matching GitHub's behavior.
Exposes entities as a public subpath export so bundlers resolve the browser condition and use the optimized DOM-based decoder instead of the full entity table.
HTML block handling and streaming mode reliability have improved.
Incomplete inline syntax, including links, images, and nested badges, streams without flashing raw markdown; incomplete images are suppressed instead of showing alt text.
The
browsercondition in the package.jsonimportsfield now provides ESM and CJS sub-conditions, so Jest with jsdom resolves the CommonJS browser entities module.camelCase attributes are preserved for all HTML/JSX tags, not just PascalCase components, so attributes like
userIdandfirstNameare no longer lowercased.Fixed missing line breaks in rendered list items when continuation lines have indentation equal to the nested list marker.
Newlines between HTML attributes are now recognized as whitespace separators, preventing incorrect attribute parsing, duplicate tags, or missing attribute values.
Attributes in multi-line HTML opening tags are now parsed into the AST, and the React compiler uses parsed children instead of re-parsing rawText when attributes are already parsed.
HTML tags with multi-line attributes no longer produce duplicate opening tags, restoring expected behavior for custom HTML elements used with component overrides.
A fence line with a language immediately after it is recognized as a new block opening that implicitly closes the previous block.
Type 6 HTML blocks now handle nested and sibling elements correctly, including siblings without blank lines between them.
Lists and other markdown structures now render correctly when input has CRLF line endings.
A paragraph after a nested list is no longer incorrectly absorbed into the nested list item when followed by a blank line.
Adds Hindi translations for UI strings and JSDoc, alongside translated documentation.
Preserves hard line breaks inside list items, including blockquotes nested within list items, so trailing spaces and newlines are correctly converted to
<br/>.Exposes parser from the markdown entry point as documented.
Exposes RuleType from the markdown entry point as documented.
In the markdown renderer, renderChildren now invokes renderRule for recursively rendered child nodes, making custom rendering logic consistent.
JSX components with blank lines between opening and closing tags now nest children instead of producing sibling nodes.
Tables within list items are now properly parsed.
Parsing HTML attributes containing invalid URI encodings, such as a percent character, now handles the values gracefully instead of throwing an error.
Angle-bracket autolinks such as <https://...> render as links when raw HTML parsing is disabled.
Parsing now applies stricter angle controls and domain underscore validation, and handles mailto labels and raw-HTML-disabled cases.
Uses Solid's hyperscript runtime so JSX returns real elements instead of [object Object] placeholders.
Changing the build target from node to browser prevents unintended node-specific code from entering browser bundles.
Fixes mutation bugs that could cause unexpected side effects when using memoization or reusing objects across compiler calls.
Fixes infinite recursion when forceBlock is true and input contains an empty unclosed HTML tag; the tag now renders as an empty element.
List-item continuation text at base indentation without a blank line is now wrapped in a separate paragraph instead of being appended inline.
Continuation text at base indentation without a preceding blank line is now appended to the list item instead of parsed as a separate paragraph.
Generated code block classes now include both language- and lang- prefixes.
Parsing now passes all 652 official CommonMark test cases and has verified GFM support for tables, task lists, strikethrough, and autolinks.
markdown-to-jsx 87 changes
Breaking changes 2
The internal type ParserResult was renamed to ASTNode; update direct type references to MarkdownToJSX.ASTNode.
Formatting rule types are consolidated into textFormatted; inspect the node’s boolean flags to determine applied formatting.
Security 1
Inline formatting parsing now uses an iterative scanner with O(n) runtime, eliminating regex-based ReDoS vulnerabilities and fixing edge case bugs.
New APIs and options 1
With ast: true, compiler returns the parsed AST instead of rendered JSX, enabling AST manipulation, custom rendering, caching, and validation.
Performance 1
HTML block parsing replaces exponential-backtracking regex behavior with an iterative depth-counting algorithm that maintains O(n) complexity.
Fixes and other changes 2
Extremely deeply nested markdown now falls back to plain text rendering instead of causing a stack overflow crash.
An unnecessary wrapper is removed when footnotes are present.
markdown-to-jsx 72 changes
Fixes and other changes 2
Passing null as children no longer crashes the app in production; it is converted to an empty string and renders nothing.
YAML frontmatter in code blocks now renders properly because Setext headings are prioritized lower than code blocks.