npm / marked
marked
What changed in marked 1 to 18, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-24.
42 breaking4 security9 deprecations15 new APIs and options12 performance7 behavior and defaults1 tooling115 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initmarked 18115 changes
Breaking changes 7
A code fence can now be closed only by a fence using the opening fence character.
A GFM www autolink now starts only at a word boundary.
Blank lines are no longer allowed inside a link reference definition label.
A whitespace-only line no longer continues a block quote paragraph.
Unbalanced parentheses in link destinations are now rejected.
GFM email autolinks are rejected when their domain ends in an underscore or hyphen.
Trailing blank lines are trimmed from block tokens.
Security 1
Fixed an infinite loop when parsing an indented code blank line.
New APIs and options 2
The lexer state now includes lastToken.
Adds lexer state that enables failing fast during link token generation.
Performance 11
The emphasis closer scan is skipped for inline runs without a delimiter.
The first character is checked before inline tokenizer regexes.
Residual O(n²) parse time on unmatched emphasis and strikethrough delimiter runs is addressed.
Fixes backtracking in pedantic HTML parsing.
Avoids a quadratic scan when emphasis delimiters are unmatched.
Parsing is about 16% faster by skipping em/strong masking for runs without *, _ or ~.
Nested lists avoid repeated raw string copies, improving parsing performance.
walkTokens now runs in linear time by appending values in place.
Avoids O(n^2) backtracking during HTML block closing and tilde interruption parsing.
Avoids O(n^2) masked source rebuilding during inline tokenization.
Avoids O(n^2) backtracking when processing inline link hrefs.
Fixes and other changes 94
A tab after the block quote marker's space is kept literal.
A lazy line that starts an HTML tag can continue a block quote paragraph.
A block quote now ends at a lazy line after an empty list item.
Tabs that are code content under a block quote are kept.
A mid-run opener can close against a delimiter that can also open.
Trailing blank lines in fenced code are preserved.
HTML blocks now allow tabs between the tag name and attributes.
Links generated by inline tokenizers are now parsed.
A link destination in angle brackets is rejected if it contains an unescaped < or >.
Bracket escapes inside code spans in link text are no longer stripped.
A list item now ends before a lazy line after an empty or non-paragraph nested block.
The CLI waits for stdout before exiting.
An autolink or inline HTML line can start or continue a setext heading.
Rejected table candidates remain in the preceding paragraph.
A task item's checkbox marker is removed from its own text.
Custom output types are preserved in tokenizer overrides.
Emphasis can open after the other delimiter character.
Emphasis can open and close inside angle brackets that are not HTML.
Hard line breaks are preserved in image alt text.
Named extension renderers preserve a return value of zero.
Text after a heading or code block in a nested list item no longer gets pulled into the outer item.
A blockquote now ends before a lazy line after a table.
Extension names are isolated from Object.prototype.
An escaped closing parenthesis or quote no longer closes an inline link or title.
Internal whitespace is collapsed when link labels are normalized.
A list item now ends before a lazy line after an HTML block.
When outputting tokens, the CLI now honors defaults and configuration.
A block quote stays open after a lazy line in a nested block quote.
Zero-valued results from custom renderers are now preserved.
Trailing tabs after a setext heading underline are now allowed.
Task list items are recognized when a tab follows the checkbox.
Promise arrays returned from walkTokens extensions are now awaited.
Per-call async options are now honored when composing hooks.
A tab after the block quote marker expands to the next tab stop.
The CLI now awaits config functions before parsing.
Emphasis flanking and rules 9-10 are applied to the whole delimiter run.
An unclosed inline raw tag no longer unescapes later blocks.
Lazy lines after a list are kept in a nested blockquote.
Duplicate link definitions are retained in the tokens.
A line starting with # but no space is kept in the list item.
Nested image alt formatting is rendered as plain text.
The CLI now creates no-clobber output files atomically.
Lazy setext underlines in list items are kept as text.
A tab or end of input after a type 6 HTML block tag name is now allowed.
Blockquotes now end before a lazy line following a heading, horizontal rule, or HTML block.
Decoded character references no longer form a new character reference.
The CLI now honors an explicitly empty string input.
Backslashes in code spans no longer hide emphasis.
Indented and type 3–5 HTML blocks can now interrupt a paragraph.
pre, script, style, and textarea are matched as whole tag names.
Enclosing link state is preserved after parsing images.
List continuation indentation now respects tab stops.
CLI configuration files can now be loaded using top-level await.
Avoids cubic backtracking on unicode whitespace in link destinations.
GFM protocol autolinks are now supported.
Setext heading text now allows indented lines.
Internal tabs in list item content are now preserved.
Whitespace is now stripped when normalizing link reference labels.
Numeric character references are now decoded in text.
Text following an empty nested blockquote is now preserved.
Leading whitespace after a hard line break is now removed.
HTML block start conditions are now matched when ending a list item.
A tab following spaces in an indented code block is now stripped.
Raw tokens are now respected when closing link labels.
Reference link labels are now case-folded during parsing.
Tabs are now allowed in the thematic break that ends a list item.
A tab is now allowed before the closing sequence of an ATX heading.
Character references in autolink destinations are now escaped.
Empty code blocks no longer receive an added newline.
Each content line removes up to the fence indentation.
HTML tags containing invalid characters in their names are now rejected.
Link labels now allow one additional level of nested brackets.
inlineTokens rebuilds the reflink-mask preamble for each call.
Links are no longer nested inside other links during parsing.
Rejected reference links retain emphasis in their text.
The em/strong mask now stays the same length as the source, correcting parsing behavior.
Backtick fences at EOF after paragraphs are now parsed correctly.
Task checkboxes are placed after list looseness is finalized, correcting list parsing.
Blockquote continuation no longer produces spurious deeper nesting during Markdown parsing.
Pedantic emphasis parsing is corrected for foo: and "word" patterns.
An unmatched strong run before emphasis now stays literal during Markdown parsing.
Extensions returning false now fall back to the default checkbox renderer.
Treats a line containing only tabs as a blank line between paragraphs.
Preserves code spans when they appear adjacent to tildes.
Keeps an empty list after a blockquote as a sibling block.
Recognizes setext headings whose first line starts with #.
Preserves trailing text on HTML block close lines for processing instructions, declarations, and CDATA.
Fixes parsing of ordered lists that follow blockquotes.
Parsing now handles empty list items that have a trailing space.
The CLI now correctly reads input from stdin.
Setext heading text no longer incorrectly receives a task checkbox.
Ensures the lookbehind regex is evaluated correctly by minifiers.
GFM table tokens no longer greedily capture trailing newlines.
Heading and definition tokens no longer greedily capture multiple newlines.
marked 1723 changes
Breaking changes 2
Consecutive text tokens in lists behave differently, which may affect code consuming or producing list tokens.
The listItem renderer is simplified, potentially requiring updates to custom renderer implementations.
Security 3
Catastrophic backtracking (ReDoS) in the link/reflink label regex was fixed.
Prevents ReDoS in the inline link regular expression title group.
Image alt text is now escaped, preventing unescaped content in rendered output.
New APIs and options 3
The list tokenizer now adds a checkbox token, exposing checkbox information to token consumers.
Checkbox tokens now have a raw property.
Checkbox tokens now have a type property.
Performance 1
Quadratic complexity in the emStrongLDelim regex was prevented.
Behavior and default changes 1
Loose list text tokens now use paragraph type in the list tokenizer.
Fixes and other changes 13
The CLI now uses a file URL when importing configuration.
Avoided a race condition when using async parallel parse or parseInline with hooks.
The CLI now honors a positional input file.
Trailing whitespace is trimmed from lheading text.
renderer.parser is reassigned at the start of each parse call to ensure fresh parser state.
Single-tilde strikethrough false positives were prevented.
tokenizer.lexer is reassigned at the start of each parse call to ensure fresh parser state.
Fixed blockquote parsing after a list.
Fixed parsing of empty list items.
Fixed list parsing when tabs are used.
Fixed incorrect indentation handling for list items.
Fixed strikethrough flanking-rule handling.
Block elements in task items are handled correctly when parsing Markdown.
marked 166 changes
Breaking changes 3
The CommonJS build is removed.
This file is removed; use ./lib/marked.umd.js instead.
The minimum supported Node.js version is now 20, enabling require to load marked.esm.js.
Tooling 1
Jest users may need to transform marked because Jest does not work with ESM by default.
Fixes and other changes 2
Avoids RegExp lookbehind assertions, improving compatibility with runtimes that do not support them.
Resolved an even-numbered backtick precedence issue in parsing.
marked 151 changes
Breaking changes 1
HTML is escaped in renderers instead of tokenizers for all tokens.
marked 143 changes
Breaking changes 3
The returned type now reflects the async option.
An error is thrown when async is false but an extension sets async to true.
useNewRenderer was removed as part of removing the old renderer.
marked 1310 changes
Breaking changes 2
Renderers receive token objects instead of multiple parameters, and parsing logic moves from the parser to renderers.
Renderer extensions that change marked renderers need to use this option and accept a token object instead of multiple parameters.
New APIs and options 5
The Renderer object now exposes the parser as a property.
A space renderer was added and returns an empty string by default.
The TableCell token now has an align property.
The TableCell token now has a header property.
A TableRow token was added.
Behavior and default changes 1
Block text tokens are now sent to the text renderer.
Fixes and other changes 2
Blockquote code continuation was fixed.
A space token is added after blockquotes and horizontal rules when there are multiple newlines.
marked 123 changes
Breaking changes 1
HTML block tag handling adds search and removes source to match the updated CommonMark spec.
Behavior and default changes 1
Punctuation handling now includes Unicode punctuation and symbol categories.
Fixes and other changes 1
HTML comment handling now includes the forms <!--> and <!--->.
marked 111 changes
Breaking changes 1
The rules object changed to support proper typing, and some intermediate rules were removed.
marked 101 changes
Breaking changes 1
Support for Node.js 16 was dropped.
marked 82 changes
Breaking changes 1
Deprecated options were removed; the notes point to extensions as the way to enable the removed options.
New APIs and options 1
The marked CLI adds --config options.
marked 72 changes
Breaking changes 2
The default for headerIds changed to false.
The default for mangle changed to false.
marked 61 changes
Breaking changes 1
Marked migrated to TypeScript, a breaking change that may affect developers using its types.
marked 511 changes
Breaking changes 1
The minimum supported Node.js version is now v18.
Deprecations 9
The baseUrl option is deprecated; use marked-base-url instead.
The callback option is deprecated; use marked-highlight instead.
The headerIds option is deprecated; use marked-gfm-heading-id instead.
The headerPrefix option is deprecated; use marked-gfm-heading-id instead.
The highlight option is deprecated; use marked-highlight instead.
The langPrefix option is deprecated; use marked-highlight instead.
The mangle option is deprecated; use marked-mangle instead.
The smartypants option is deprecated; use marked-smartypants instead.
The xhtml option is deprecated; use marked-xhtml instead.
New APIs and options 1
The html renderer gains a block parameter.
marked 43 changes
Breaking changes 3
The default export was removed; import marked as a named export or destructure it from require('marked').
The file was removed; use /marked.min.js in a script tag instead.
When using marked in a script tag, call marked.parse(...) instead of marked(...).
marked 310 changes
Breaking changes 8
List parsing now has full CommonMark compliance.
The inlineText tokenizer function signature has changed.
Node 10 is no longer supported.
The nptable tokenizer was removed and merged with the table tokenizer.
Table token headers now contain cell objects with text and tokens; cells was replaced by rows, whose cells also contain text and tokens.
The tag tokenizer function signature has changed.
The extensions tokenizer this object now includes the lexer; this.inlineTokens becomes this.lexer.inline.
The extensions renderer this object now includes the parser; this.parseInline becomes this.parser.parseInline.
New APIs and options 1
A module field was added to package.json, changing package entry metadata.
Behavior and default changes 1
Tokenizers create their own child tokens with this.lexer.inline; token creation is queued until after all block tokens are created.
marked 26 changes
Breaking changes 4
The code tokenizer no longer receives all tokens as its second parameter.
The em and strong tokenizers have been merged into one emStrong tokenizer.
IE 11 is no longer officially supported, though it may still work; the es5 version remains available and may require polyfills.
The text tokenizer no longer receives all tokens as its second parameter.
Behavior and default changes 2
Adjacent inlineText tokens are joined.
Emphasis and Strong handling was totally reworked.
marked 17 changes
Breaking changes 1
The lexer output now includes inline tokens, changing the tokens returned to developers.
New APIs and options 2
The new method lets developers extend options.
A Tokenizer is available to allow extending token creation.
Behavior and default changes 1
Escape tokens are treated the same way as plain text tokens.
Fixes and other changes 3
Fixes the italics modifier breaking links that contain underscores.
Fixes incorrect closing-delimiter handling for consecutive occurrences.
Fixes intra-word emphasis matching the wrong asterisks.