Update dependency markdown-to-jsx to v9#216
Open
renovate[bot] wants to merge 1 commit into
Open
Conversation
✅ Deploy Preview for auto-annotated-portfolio ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
9f50ef5 to
ed9439a
Compare
cf35499 to
54fcbcd
Compare
d6bd50f to
6c00329
Compare
8bcb755 to
8224fc9
Compare
55b47ef to
f4f0600
Compare
6c5a571 to
2eb3f53
Compare
2723e58 to
5b76c09
Compare
5a908df to
3f582bc
Compare
3f582bc to
6ab5e42
Compare
6ab5e42 to
9402643
Compare
9402643 to
62d4a3e
Compare
de29be4 to
7d684ba
Compare
7d684ba to
d9cf423
Compare
d9cf423 to
a9d551d
Compare
a9d551d to
bfe7b06
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^7.7.1→^9.0.0Release Notes
quantizor/markdown-to-jsx (markdown-to-jsx)
v9.8.2Compare Source
Patch Changes
47408cd: Parsing is significantly faster, around 40% on large documents, with the biggest gains on link-heavy and code-heavy content. Also fixed an edge case where a reference definition split across blockquote lines could be matched by a link using the raw, unnormalized label.47408cd: Documents with many bold or italic spans now parse in a fraction of the time. Previously, parsing slowed down sharply as the number of emphasized spans grew, which could make very large or adversarial inputs hang.47408cd: The<Markdown>component no longer re-parses its content when a parent re-renders with unchanged props. Previously the rest-props object was reallocated on every render, which invalidated the internal compile cache and forced a full re-parse each time.47408cd: Text on its own line after a nested HTML element (such as content following</summary>inside<details>) now renders instead of being dropped or misplaced when no blank line separates them. This now behaves consistently across the React, React Native, Solid, and Vue outputs.v9.8.1Compare Source
Patch Changes
24661c0: fix: stop fast-skip from truncating bare email local-parts containing inline-special charsc0c432f: Markdown with many malformed link starts (e.g. repeated[]() now parses quickly instead of slowing to a crawl on large inputs.v9.8.0Compare Source
Minor Changes
51a68b1: React Native:overridesnow work the same as on web. Pass an override forcode,pre,strong,em,del,blockquote,hr,h1–h6,ul,ol,li, orinputand it fires for parsed markdown — no more silent no-ops on inline emphasis, fenced code, headings, lists, or GFM task checkboxes. Thestylesprop is also tightened: each key is narrowed to the style type its component actually accepts (TextStyle,ViewStyle, orImageStyle), so passing anImageStyletoparagraphis now a compile-time error. Task list items now render with sensible row + center-aligned defaults so the checkbox and label sit on the same line out of the box; pass your ownstyles.listItemto opt out (e.g. for multi-line task labels). TheMarkdowncomponent additionally acceptsstring[]children to absorb the common JSX case where children arrive as a coalesced array.v9.7.16Compare Source
Patch Changes
fb5efc2: Fix HTML output for markdown inside<table>cells (#862). Lists, blockquotes, fenced code, and headings inside a cell now render as nested content without breaking the surrounding rows or dropping closing tags.v9.7.15Compare Source
Patch Changes
7ff0713: Fix React 19 RSC dev warning "Attempted to render without development properties"v9.7.14Compare Source
Patch Changes
3df970f: Fix frontmatter detection silently consuming content when a thematic break (---) starts the document. The colon-anywhere heuristic is replaced with proper YAML key-value validation, and a newdisableFrontmatteroption is added to skip detection entirely.c7e0d07: Fix<hr>and other void HTML elements silently dropping all subsequent content when not followed by a newline (#856)c7e0d07: Fix HTML blocks with markdown content inside tables (#862) and restore CommonMark-correct behavior for HTML block content without blank lines (#860)<div>\n*text*\n</div>) is now preserved as literal text per CommonMark Example 189<div>\n\n*text*\n\n</div>) continues to parse markdown as before (CommonMark Example 188)0dfde05: Fix HTML compiler dropping the closing tag for empty non-void elements (e.g.<p></p>rendered as<p>,<div></div>rendered as<div>)b0a7c68: fix: add key props to thead/tbody in table rendering to resolve React key warning (#858)c7e0d07: Fix Vue adapter "Non-function value encountered for default slot" warning when using component overrides (#855)v9.7.13Compare Source
Patch Changes
bcf178a: Fix streaming mode incorrectly stripping self-closing custom component tags (e.g.<CustomButton />) and leaking incomplete trailing tags as escaped text in inline content.修复流式模式错误地移除自闭合自定义组件标签(如
<CustomButton />),以及内联内容中不完整的尾部标签作为转义文本泄漏的问题。स्ट्रीमिंग मोड में सेल्फ-क्लोज़िंग कस्टम कंपोनेंट टैग (जैसे
<CustomButton />) को गलत तरीके से हटाने और इनलाइन कंटेंट में अपूर्ण ट्रेलिंग टैग को एस्केप्ड टेक्स्ट के रूप में लीक होने की समस्या को ठीक करें।v9.7.12Compare Source
Patch Changes
1c430ae: Fix missing TypeScript declaration files in published package. Add standalone post-build verification that fails the build when type declarations are not generated, independent of the bundler's plugin system.发布包中缺少 TypeScript 声明文件的修复。添加独立的构建后验证,当类型声明未生成时构建失败,不依赖于打包器的插件系统。
प्रकाशित पैकेज में गायब TypeScript डिक्लेरेशन फ़ाइलों को ठीक करें। स्वतंत्र बिल्ड-बाद सत्यापन जोड़ें जो टाइप डिक्लेरेशन जनरेट न होने पर बिल्ड विफल करे, बंडलर के प्लगइन सिस्टम से स्वतंत्र।
v9.7.11Compare Source
Patch Changes
5eecb05: Skip rendering empty tbody when a table has only a header row and no data rows.仅有表头行而无数据行的表格不再渲染空的 tbody。
केवल हेडर पंक्ति और कोई डेटा पंक्ति न होने पर खाली tbody रेंडर नहीं किया जाता।
130cc33: Suppress React 19 RSC development warning about missing internal properties on manually-created elements.修复 React 19 RSC 开发模式下手动创建的元素缺少内部属性时产生的警告。
React 19 RSC के विकास मोड में मैन्युअल रूप से बनाए गए तत्वों पर आंतरिक गुणों की अनुपस्थिति संबंधी चेतावनी को ठीक किया।
v9.7.10Compare Source
Patch Changes
3daa41e: fix: strip trailing asterisks from bare URL href (fixes #839)When a bare URL was wrapped in bold markdown (
**url**), the generated link'shrefincorrectly included the closing asterisks (e.g.href="https://example.com/foo**"). The parser now trims trailing*from bare URLs so the href is correct. No consumer changes required.当裸 URL 包裹在粗体 markdown(
**url**)中时,生成的链接href错误地包含了闭合星号(例如href="https://example.com/foo**")。解析器现在会从裸 URL 中去除尾部的*,使 href 正确。无需更改消费者代码。जब एक बेयर URL बोल्ड markdown (
**url**) में लपेटा गया था, तो जनरेट किए गए लिंक काhrefगलत तरीके से क्लोज़िंग एस्टेरिस्क शामिल करता था (जैसेhref="https://example.com/foo**")। पार्सर अब बेयर URL से अनुगामी*को हटा देता है ताकि href सही हो। कोई उपभोक्ता परिवर्तन आवश्यक नहीं है।f520531: resolve emphasis delimiters closing before hard line breaks (two trailing spaces or backslash before newline)解决在硬换行符(换行前有两个尾随空格或反斜杠)之前关闭强调分隔符的问题
हार्ड लाइन ब्रेक (न्यूलाइन से पहले दो ट्रेलिंग स्पेस या बैकस्लैश) से पहले एम्फ़ैसिस डिलीमिटर बंद होने की समस्या हल की
f520531: include _store on raw React elements unconditionally so React dev-mode validation works in all bundler environments无条件地在原始 React 元素上包含 _store,使 React 开发模式验证在所有打包器环境中正常工作
सभी बंडलर वातावरण में React डेव-मोड सत्यापन काम करने के लिए रॉ React एलिमेंट्स पर बिना शर्त _store शामिल करें
v9.7.9Compare Source
Patch Changes
2d21e43: Fail the build when type declarations are not generated, preventing releases without TypeScript types.当类型声明未生成时构建失败,防止发布缺少 TypeScript 类型的版本。
टाइप डिक्लेरेशन जनरेट न होने पर बिल्ड विफल करें, TypeScript टाइप्स के बिना रिलीज़ को रोकें।
v9.7.8Compare Source
Patch Changes
58502fc: Resolve broken exports in bundled output caused by Bun bundler bug with cross-entry re-exports解决由 Bun 打包器跨入口点重导出 bug 导致的打包输出中导出失效问题
Bun बंडलर के क्रॉस-एंट्री री-एक्सपोर्ट बग से होने वाली बंडल आउटपुट में टूटी हुई exports को ठीक किया
v9.7.7Compare Source
Patch Changes
e0100f0: fix: nested HTML blocks with same tag name now correctly match depth-paired closing tags修复:嵌套的同名 HTML 块现在能正确匹配深度配对的关闭标签
修正:समान टैग नाम वाले नेस्टेड HTML ब्लॉक अब सही ढंग से गहराई-युग्मित समापन टैग से मिलान करते हैं
bf5d906: fix: suppress ambiguous setext headings during streaming to avoid premature heading rendering修复:在流式传输过程中抑制歧义的 Setext 标题,避免过早渲染标题
修正:स्ट्रीमिंग के दौरान अस्पष्ट Setext शीर्षकों को दबाएं ताकि समय से पहले शीर्षक प्रदर्शन न हो
v9.7.6Compare Source
Patch Changes
565e3ea: fix: add missing_ownerfield on raw React elements for dev-mode compatibilityFixes "Cannot set properties of undefined (setting 'validated')" errors in React 19 dev mode by adding the
_ownerfield that React's reconciler expects on all elements.修复:在原始 React 元素上添加缺失的
_owner字段,解决 React 19 开发模式下的兼容性问题。सुधार: React 19 डेवलपमेंट मोड में "Cannot set properties of undefined" त्रुटि को ठीक करने के लिए raw React तत्वों पर गायब
_ownerफ़ील्ड जोड़ा गया।565e3ea: fix: prevent void elements from receiving children when preceded by a blank lineVoid HTML elements (e.g.
<br>,<hr>,<img>) preceded by a blank line no longer cause React error #137. The parser now returns void elements as content-less blocks, and all compilers guard against passing children to void elements.修复:当空行后跟空元素(如
<br>、<hr>、<img>)时,不再触发 React 错误 #137。解析器现在将空元素作为无内容块返回,所有编译器均防止向空元素传递子元素。सुधार: जब खाली पंक्ति के बाद void तत्व (जैसे
<br>,<hr>,<img>) आते हैं, तो अब React त्रुटि #137 नहीं होती। पार्सर अब void तत्वों को बिना सामग्री वाले ब्लॉक के रूप में लौटाता है, और सभी कंपाइलर void तत्वों को चाइल्ड तत्व देने से रोकते हैं।v9.7.5Compare Source
Patch Changes
cc1a8a7: Fix "Cannot set properties of undefined (setting 'validated')" error introduced in 9.7.1. React's dev-mode reconciler setselement._store.validatedto track element creation source; raw elements created by the fast path now include_store: {}in non-production builds.修复 9.7.1 引入的 "Cannot set properties of undefined (setting 'validated')" 错误。React 开发模式协调器设置
element._store.validated来追踪元素创建来源;快速路径创建的原始元素现在在非生产构建中包含_store: {}。9.7.1 में पेश हुई "Cannot set properties of undefined (setting 'validated')" त्रुटि ठीक की गई। React के dev-mode reconciler द्वारा
element._store.validatedसेट करने के लिए, फास्ट पाथ से बनाए गए raw elements अब non-production builds में_store: {}शामिल करते हैं।v9.7.4Compare Source
Patch Changes
01b68df: - Fix HTML entity decoding in link titles (e.g.–now correctly decodes to–)<pre>,<script>,<style>, and<textarea>content being incorrectly parsed as markdown instead of rendered verbatim–现在正确解码为–)<pre>、<script>、<style>和<textarea>内容被错误解析为 Markdown 而非原始文本渲染的问题–अब सही ढंग से–में बदलता है)<pre>,<script>,<style>, और<textarea>सामग्री को Markdown के बजाय यथावत् रेंडर करेंv9.7.3Compare Source
Patch Changes
2dca780: Improve HTML compiler performance by ~57%, bringing it to parity with the React compiler.HTML 编译器性能提升约 57%,与 React 编译器持平。
HTML कंपाइलर के प्रदर्शन में ~57% सुधार, React कंपाइलर के बराबर।
v9.7.2Compare Source
Patch Changes
30db3f3: Accept case-insensitive GFM alert blockquote syntax (e.g.,[!Tip],[!tip]) matching GitHub's behavior.接受不区分大小写的 GFM 警告引用块语法(例如
[!Tip]、[!tip]),与 GitHub 的行为保持一致。GFM अलर्ट ब्लॉककोट सिंटैक्स में केस-इनसेंसिटिव मिलान स्वीकार करें (जैसे
[!Tip],[!tip]), GitHub के व्यवहार के अनुरूप।da2eb8c: Moved benchmarking and documentation website dev dependencies out of the library package for cleaner dependency management.将基准测试和文档网站开发依赖项移出库包以实现更清晰的依赖管理。
बेंचमार्किंग और डॉक्यूमेंटेशन वेबसाइट डेव डिपेंडेंसी को साफ डिपेंडेंसी मैनेजमेंट के लिए लाइब्रेरी पैकेज से बाहर ले जाया गया।
v9.7.1Compare Source
Patch Changes
9830b70: Fix entity resolution in CodeSandbox and other bundlers by exposing entities as a public subpath export. Bundlers now resolvemarkdown-to-jsx/entitiesusing thebrowsercondition, ensuring the optimized DOM-based decoder (~300B) is used in browsers instead of the full entity table (~29KB).通过将实体作为公共子路径导出来修复 CodeSandbox 和其他打包工具中的实体解析。打包工具现在使用
browser条件解析markdown-to-jsx/entities,确保浏览器使用优化的基于 DOM 的解码器(约 300B)而不是完整的实体表(约 29KB)。CodeSandbox और अन्य बंडलर में एंटिटी रिज़ॉल्यूशन को ठीक करने के लिए एंटिटी को सार्वजनिक सबपाथ एक्सपोर्ट के रूप में एक्सपोज़ किया गया। बंडलर अब
browserकंडीशन का उपयोग करकेmarkdown-to-jsx/entitiesको रिज़ॉल्व करते हैं, यह सुनिश्चित करते हुए कि ब्राउज़र में पूर्ण एंटिटी टेबल (~29KB) के बजाय ऑप्टिमाइज़्ड DOM-आधारित डिकोडर (~300B) का उपयोग किया जाता है।e537dca: Bypass React.createElement for ~2x faster JSX output by constructing raw React element objects directly. The $$typeof symbol is auto-detected from the installed React version for forward compatibility. Falls back to createElement when a custom createElement option is provided.绕过 React.createElement,通过直接构造原始 React 元素对象实现约 2 倍的 JSX 输出速度提升。$$typeof 符号从已安装的 React 版本自动检测以确保前向兼容性。当提供自定义 createElement 选项时回退到 createElement。
React.createElement को बायपास करके कच्चे React एलिमेंट ऑब्जेक्ट सीधे बनाकर ~2x तेज़ JSX आउटपुट। $$typeof सिंबल आगे की संगतता के लिए स्थापित React संस्करण से स्वतः पहचाना जाता है। कस्टम createElement विकल्प प्रदान करने पर createElement पर वापस आता है।
v9.7.0Compare Source
Minor Changes
ab93d7b: Replaced the rule-based markdown parser with a compact table-driven parser. Parsing is 27-82% faster depending on input size and bundle size is reduced by ~25% (gzip). Improved CommonMark compliance for HTML block handling and streaming mode reliability. No API changes.用紧凑的表驱动解析器替换了基于规则的 markdown 解析器。根据输入大小,解析速度提升 27-82%,包体积减少约 25%(gzip)。改进了 HTML 块处理和流式模式可靠性的 CommonMark 合规性。无 API 更改。
नियम-आधारित markdown पार्सर को कॉम्पैक्ट टेबल-ड्रिवन पार्सर से बदला गया। इनपुट आकार के अनुसार पार्सिंग 27-82% तेज़ है और बंडल आकार ~25% (gzip) कम हुआ। HTML ब्लॉक हैंडलिंग और स्ट्रीमिंग मोड विश्वसनीयता के लिए CommonMark अनुपालन में सुधार। कोई API परिवर्तन नहीं।
Patch Changes
ab93d7b: Fixed attribute casing preservation across all output adapters. The parser no longer modifies attribute names; each adapter handles its own mappings. React/Native convert to JSX props (class->className, XML namespaces via colon-to-camelCase heuristic). Solid usesclassper framework guidance. Vue passes HTML attributes directly.修复了所有输出适配器中的属性大小写保留。解析器不再修改属性名称;每个适配器处理自己的映射。React/Native 转换为 JSX 属性(class->className,XML 命名空间通过冒号转驼峰启发式)。Solid 按框架指南使用
class。Vue 直接传递 HTML 属性。सभी आउटपुट एडेप्टर में एट्रिब्यूट केसिंग संरक्षण ठीक किया गया। पार्सर अब एट्रिब्यूट नामों को संशोधित नहीं करता; प्रत्येक एडेप्टर अपनी मैपिंग संभालता है। React/Native JSX props में बदलता है (class->className, XML नेमस्पेस कोलन-टू-कैमलकेस से)। Solid फ्रेमवर्क दिशानिर्देश के अनुसार
classउपयोग करता है। Vue सीधे HTML एट्रिब्यूट पास करता है।ab93d7b: ImprovedoptimizeForStreaminghandling of incomplete inline syntax. Bold/italic/strikethrough markers, links, images, and nested badge constructs ([](url)) now stream cleanly without flashing raw markdown syntax. Incomplete images are fully suppressed instead of showing alt text.改进了
optimizeForStreaming对不完整内联语法的处理。粗体/斜体/删除线标记、链接、图片和嵌套徽章构造([](url))现在可以流畅地流式传输,不会闪烁原始 markdown 语法。不完整的图片会被完全抑制,而不是显示替代文本。optimizeForStreamingमें अपूर्ण इनलाइन सिंटैक्स की हैंडलिंग में सुधार। बोल्ड/इटैलिक/स्ट्राइकथ्रू मार्कर, लिंक, इमेज, और नेस्टेड बैज कंस्ट्रक्ट ([](url)) अब raw markdown सिंटैक्स की झलक के बिना सुचारू रूप से स्ट्रीम होते हैं। अपूर्ण इमेज alt टेक्स्ट दिखाने के बजाय पूरी तरह से दबा दी जाती हैं।v9.6.1Compare Source
Patch Changes
9bf4bad: Fix: Jest test suites failing with "Unexpected token 'export'" when using the library with jsdom environment. Thebrowsercondition in the package.jsonimportsfield now correctly provides both ESM (import) and CJS (require) sub-conditions, ensuring Jest resolves to the CommonJS version of the browser entities module.修复:当在 jsdom 环境中使用该库时,Jest 测试套件会因"Unexpected token 'export'"而失败。package.json
imports字段中的browser条件现在正确提供 ESM(import)和 CJS(require)子条件,确保 Jest 解析到浏览器实体模块的 CommonJS 版本。फिक्स: jsdom वातावरण में लाइब्रेरी का उपयोग करते समय Jest टेस्ट सुइट "Unexpected token 'export'" त्रुटि के साथ विफल हो रहे थे। package.json
importsफ़ील्ड मेंbrowserकंडीशन अब सही ढंग से ESM (import) और CJS (require) सब-कंडीशन प्रदान करती है, जिससे Jest ब्राउज़र एंटिटी मॉड्यूल के CommonJS संस्करण को सही ढंग से रिज़ॉल्व करता है।2432f0b: Fix: preserve camelCase attribute casing for all HTML/JSX tags, not just PascalCase components. This restores expected behavior where attributes likeuserIdandfirstNameare no longer lowercased touseridandfirstname.修复:为所有 HTML/JSX 标签保留 camelCase 属性大小写,而不仅仅是 PascalCase 组件。这恢复了预期行为,使得
userId和firstName等属性不再被转换为小写的userid和firstname。फिक्स: सभी HTML/JSX टैग के लिए camelCase एट्रिब्यूट केसिंग को संरक्षित करें, न कि केवल PascalCase कंपोनेंट के लिए। यह अपेक्षित व्यवहार को बहाल करता है जहां
userIdऔरfirstNameजैसे एट्रिब्यूट अब लोअरकेसuseridऔरfirstnameमें परिवर्तित नहीं होते हैं।v9.6.0Compare Source
Minor Changes
a97e2bf: AddoptimizeForStreamingoption to suppress incomplete syntax during streaming. When enabled, incomplete inline code, links, emphasis, and other markdown syntax is hidden cleanly as characters arrive, preventing visual artifacts and flickering. Particularly useful for AI-powered streaming applications.v9.5.7Compare Source
Patch Changes
4252da4: Fixed inconsistent spacing between list item nodes when continuation lines have indentation equal to the nested list marker. Previously, text nodes in list items were being concatenated without newlines when continuation lines matched the list's base indentation, causing missing line breaks in the rendered output.v9.5.6Compare Source
Patch Changes
13bdaf7: Fixed HTML tags with attributes spanning multiple lines being incorrectly parsed.Previously, HTML tags with attributes on separate lines (like
<dl-custom\n data-variant='horizontalTable'\n>) would have their attributes incorrectly parsed, sometimes causing duplicate tags or missing attribute values. This fix ensures that newlines between HTML attributes are properly recognized as whitespace separators.修复了属性跨多行的 HTML 标签解析不正确的问题。
之前,属性位于单独行上的 HTML 标签(如
<dl-custom\n data-variant='horizontalTable'\n>)的属性解析不正确,有时会导致重复的标签或缺失属性值。此修复确保 HTML 属性之间的换行符被正确识别为空白分隔符。कई पंक्तियों में फैले एट्रिब्यूट वाले HTML टैग्स के गलत पार्सिंग को ठीक किया।
पहले, अलग-अलग पंक्तियों पर एट्रिब्यूट वाले HTML टैग्स (जैसे
<dl-custom\n data-variant='horizontalTable'\n>) के एट्रिब्यूट गलत तरीके से पार्स होते थे, जिससे कभी-कभी डुप्लिकेट टैग्स या गायब एट्रिब्यूट वैल्यू होते थे। यह फिक्स सुनिश्चित करता है कि HTML एट्रिब्यूट के बीच न्यूलाइन को व्हाइटस्पेस सेपरेटर के रूप में सही ढंग से पहचाना जाता है।13bdaf7: Thetextfield in HTML AST nodes now contains cleaned inner content without opening/closing tags. UserawTextfor full raw HTML. This affects customrenderRuleimplementations that rely on thetextfield.HTML AST 节点中的
text字段现在包含不带开/闭标签的清理后内容。使用rawText获取完整原始 HTML。这会影响依赖text字段的自定义renderRule实现。HTML AST नोड्स में
textफ़ील्ड अब ओपनिंग/क्लोज़िंग टैग्स के बिना साफ़ इनर कंटेंट रखता है। पूर्ण raw HTML के लिएrawTextका उपयोग करें। यह उन कस्टमrenderRuleकार्यान्वयनों को प्रभावित करता है जोtextफ़ील्ड पर निर्भर हैं।v9.5.5Compare Source
Patch Changes
76b7f12: Fix multi-line HTML tag attribute parsing (#781)HTML tags with attributes spanning multiple lines were not having their attributes correctly parsed into the AST. This caused custom elements with multi-line
data-*attributes to have emptyattrsobjects, and the React compiler would then duplicate the opening tag when rendering.This fix ensures:
childrenarray instead of re-parsingrawTextwhen attributes are already parsed修复多行 HTML 标签属性解析问题(#781)
具有跨多行属性的 HTML 标签没有正确将其属性解析到 AST 中。这导致具有多行
data-*属性的自定义元素具有空的attrs对象,然后 React 编译器在渲染时会重复开始标签。此修复确保:
children数组而不是重新解析rawTextबहु-पंक्ति HTML टैग विशेषता पार्सिंग ठीक करें (#781)
कई पंक्तियों में फैले विशेषताओं वाले HTML टैग अपनी विशेषताओं को AST में सही ढंग से पार्स नहीं कर रहे थे। इससे बहु-पंक्ति
data-*विशेषताओं वाले कस्टम तत्वों में खालीattrsऑब्जेक्ट थे, और फिर React कंपाइलर रेंडरिंग करते समय आरंभिक टैग को दोहरा देता था।यह सुधार सुनिश्चित करता है:
rawTextको दोबारा पार्स करने के बजाय पार्स किए गएchildrenसरणी का उपयोग करता हैv9.5.4Compare Source
Patch Changes
7f724a6: Fix HTML block parsing for sibling elements like<dt>/<dd>without blank lines between them.Type 6 HTML blocks (such as
<dl>,<dt>,<dd>,<table>,<tr>,<td>) were incorrectly parsed when sibling elements appeared without blank lines between them—the first element would consume all subsequent siblings as its content instead of treating them as separate elements.This fix adds nesting-aware closing tag detection that properly handles:
<div><div></div></div>)<dt></dt><dd></dd>)修复了没有空行分隔的兄弟 HTML 元素(如
<dt>/<dd>)的块解析问题。类型 6 HTML 块(如
<dl>、<dt>、<dd>、<table>、<tr>、<td>)在兄弟元素之间没有空行时解析错误——第一个元素会将所有后续兄弟元素作为其内容,而不是将它们视为单独的元素。此修复添加了具有嵌套感知的关闭标签检测,正确处理:
<div><div></div></div>)<dt></dt><dd></dd>)रिक्त पंक्तियों के बिना भाई HTML तत्वों (जैसे
<dt>/<dd>) के लिए HTML ब्लॉक पार्सिंग को ठीक किया।टाइप 6 HTML ब्लॉक (जैसे
<dl>,<dt>,<dd>,<table>,<tr>,<td>) गलत तरीके से पार्स हो रहे थे जब भाई तत्व बिना रिक्त पंक्तियों के दिखाई देते थे—पहला तत्व सभी अनुवर्ती भाई तत्वों को अपनी सामग्री के रूप में शामिल कर लेता था, उन्हें अलग तत्वों के रूप में मानने के बजाय।यह सुधार नेस्टिंग-जागरूक क्लोजिंग टैग पहचान जोड़ता है जो सही ढंग से संभालता है:
<div><div></div></div>)<dt></dt><dd></dd>)58010ce: Fix duplicate opening tags for HTML elements with multi-line attributes (#781)HTML tags with attributes spanning multiple lines (like custom elements with
data-*attributes on separate lines) no longer produce duplicate opening tags in the output. This restores the expected behavior for custom HTML elements used with component overrides.修复多行属性的 HTML 元素产生重复开始标签的问题(#781)
具有跨多行属性的 HTML 标签(例如在不同行上具有
data-*属性的自定义元素)不再在输出中产生重复的开始标签。这恢复了与组件覆盖一起使用的自定义 HTML 元素的预期行为。बहु-पंक्ति विशेषताओं वाले HTML तत्वों के लिए दोहरे आरंभिक टैग ठीक करें (#781)
कई पंक्तियों में फैली विशेषताओं वाले HTML टैग (जैसे अलग-अलग पंक्तियों पर
data-*विशेषताओं वाले कस्टम तत्व) अब आउटपुट में दोहरे आरंभिक टैग उत्पन्न नहीं करते। यह कंपोनेंट ओवरराइड के साथ उपयोग किए जाने वाले कस्टम HTML तत्वों के अपेक्षित व्यवहार को पुनर्स्थापित करता है।3e25913: Fix fenced code blocks consuming nested code block openings as content.When a fenced code block with a language (e.g.,
```markdown) encountered another code block opening with a language (e.g.,```python) inside it, the inner opening was incorrectly treated as content instead of being recognized as a new block. Now, fence lines with a language immediately following (no space between fence and language) are recognized as new block openings that implicitly close the previous block.This matches behavior of other markdown renderers like GitHub and VSCode. Lines like
``` aaa(with space before info string) remain treated as content per CommonMark spec.修复了围栏代码块将嵌套代码块开头作为内容消费的问题。
当带有语言的围栏代码块(例如
```markdown)内部遇到另一个带语言的代码块开头(例如```python)时,内部开头被错误地视为内容,而不是被识别为新块。现在,语言紧随其后(围栏和语言之间没有空格)的围栏行被识别为隐式关闭前一个块的新块开头。这与 GitHub 和 VSCode 等其他 markdown 渲染器的行为一致。按照 CommonMark 规范,像
``` aaa(信息字符串前有空格)这样的行仍被视为内容。फेंस्ड कोड ब्लॉक्स द्वारा नेस्टेड कोड ब्लॉक ओपनिंग को सामग्री के रूप में उपभोग करने की समस्या को ठीक किया।
जब भाषा वाला फेंस्ड कोड ब्लॉक (जैसे
```markdown) के अंदर भाषा वाला दूसरा कोड ब्लॉक ओपनिंग (जैसे```python) आता था, तो आंतरिक ओपनिंग को नए ब्लॉक के रूप में पहचानने के बजाय गलती से सामग्री के रूप में माना जाता था। अब, भाषा तुरंत बाद आने वाली (फेंस और भाषा के बीच कोई स्पेस नहीं) फेंस लाइनें नए ब्लॉक ओपनिंग के रूप में पहचानी जाती हैं जो पिछले ब्लॉक को निहित रूप से बंद करती हैं।यह GitHub और VSCode जैसे अन्य markdown रेंडरर के व्यवहार से मेल खाता है। CommonMark स्पेक के अनुसार
``` aaa(इन्फो स्ट्रिंग से पहले स्पेस) जैसी लाइनें अभी भी सामग्री के रूप में मानी जाती हैं।v9.5.3Compare Source
Patch Changes
8528325: Add CommonMark-compliant text normalization for null bytes and BOMPer CommonMark security specification, null bytes (U+0000) are now replaced with the replacement character (U+FFFD) instead of passing through unchanged. Additionally, the Byte Order Mark (U+FEFF) is now stripped when it appears at the start of a document, as specified in the CommonMark spec.
These changes improve spec compliance and security. Most documents are unaffected due to fast-path optimization that skips processing when no special characters are present.
v9.5.2Compare Source
Patch Changes
282affe: Fix lists and other markdown structures not rendering correctly when input has CRLF line endings.282affe: Fix paragraph after nested list being incorrectly absorbed into the nested list item when followed by a blank line.v9.5.1Compare Source
Patch Changes
fa21868: Add Chinese (Mandarin) JSDoc documentation to all public APIs. All exported functions, types, interfaces, and components now include bilingual documentation using the@lang zhtag for Simplified Chinese translations, improving developer experience for Chinese-speaking users.fa21868: Add Hindi (हिन्दी) language support for internationalization. Includes full translations of documentation (README, markdown spec, GFM spec, interactive demo template), UI strings, and JSDoc translations for all public APIs using the@lang hitag. Hindi is now the third supported language after English and Mandarin Chinese, following global speaker rankings (Ethnologue 2025).897c4c2: Automatic browser bundle optimization via conditional exports. Browser builds now automatically use DOM-based entity decoding (textarea.innerHTML) instead of shipping the full ~11KB entity lookup table, reducing gzipped bundle size by ~11KB.This optimization is automatic for bundlers that support the
importsfield withbrowsercondition (Webpack 5+, Vite, esbuild, Rollup, Parcel). No configuration required.Server-side/Node.js builds retain the full O(1) entity lookup table for maximum performance.
This feature uses the
importsfield in package.json. All modern bundlers support this field (Webpack 5+, Vite, esbuild, Rollup, Parcel).v9.5.0Compare Source
Minor Changes
7605d88: Add React Server Components (RSC) support with automatic environment detection.The
Markdowncomponent now seamlessly works in both RSC and client-side React environments without requiring 'use client' directives. The component automatically detects hook availability and adapts its behavior accordingly:MarkdownProviderandMarkdownContextgracefully become no-ops in RSC environmentsThis enables better bundle splitting and SSR performance by allowing markdown rendering to happen on the server when possible.
Patch Changes
d2075d2: Fix hard line breaks (two trailing spaces) inside list items not being converted to<br/>.In v9, hard line breaks inside list items were being lost because the first line content and continuation lines were being parsed separately, causing the trailing spaces before the newline to be stripped before the hard break could be detected.
The fix ensures that for tight list items (without blank lines), simple text continuation lines are collected and concatenated with the first line content before parsing. This preserves the trailing spaces + newline sequence that triggers hard break detection.
This fix also handles hard line breaks inside blockquotes that are nested within list items, ensuring the blockquote continuation lines are properly collected together.
Fixes #766.
v9.4.2Compare Source
Patch Changes
775b4bf: ExposeparserandRuleTypefrom the markdown entry point as documented.v9.4.1Compare Source
Patch Changes
7ee8a22: EnsurerenderRulealways executes before any other rendering code across all renderers. TherenderRulefunction now has full control over node rendering, including normally-skipped nodes likeref,footnote, andfrontmatter. Additionally,renderChildrenin the markdown renderer now invokesrenderRulefor recursively rendered child nodes, ensuring consistent behavior when customizing rendering logic.7ee8a22: HTML blocks are now always fully parsed into the ASTchildrenproperty, even when marked asverbatim. Theverbatimflag now acts as a rendering hint rather than a parsing control. Default renderers still userawTextfor verbatim blocks (maintaining CommonMark compliance), butrenderRuleimplementations can now access the fully parsed AST inchildrenfor all HTML blocks. ThenoInnerParseproperty has been replaced withverbatimfor clarity.7ee8a22: AddHTMLNode.rawTextfield for consistency withrawAttrs. TherawTextfield contains the raw text content for verbatim HTML blocks, whilechildrencontains the parsed AST. Thetextproperty is now deprecated and will be removed in a future major version. Both fields are set to the same value for backward compatibility.v9.4.0Compare Source
Minor Changes
c1be885: Added context providers and memoization to all major renderers for better developer experience and performance.React:
MarkdownContext- React context for default optionsMarkdownProvider- Provider component to avoid prop-drillinguseMemo- 3-stage memoization (options, content, JSX)React Native:
MarkdownContext- React context for default optionsMarkdownProvider- Provider component to avoid prop-drillinguseMemo- 3-stage memoization (options, content, JSX)Vue:
MarkdownOptionsKey- InjectionKey for provide/inject patternMarkdownProvider- Provider component using Vue's providecomputed- Reactive memoization for options, content, and JSXBenefits:
Example:
ef8a002: Added opt-inoptions.evalUnserializableExpressionsto eval function expressions and other unserializable JSX props from trusted markdown sources.This option uses
eval()and should ONLY be used with completely trusted markdown sources (e.g., your own documentation). Never enable this for user-submitted content.Usage:
Safer alternative: Use
renderRuleto handle stringified expressions on a case-by-case basis with your own validation and allowlists.See the README for detailed security considerations and safe alternatives.
ef8a002: JSX prop values are now intelligently parsed instead of always being strings:JSON.parse():data={[1, 2, 3]}→attrs.data = [1, 2, 3]enabled={true}→attrs.enabled = trueonClick={() => ...}→attrs.onClick = "() => ..."value={someVar}→attrs.value = "someVar"The original raw attribute string is preserved in the
rawAttrsfield.Benefits:
Example:
Security: Functions remain as strings by default. Use
renderRulefor case-by-case handling, or see the newoptions.evalUnserializableExpressionsfeature for opt-in eval (not recommended for user inputs).Patch Changes
ef8a002: JSX components with double-newlines (blank lines) between opening and closing tags now properly nest children instead of creating sibling nodes. This fixes incorrect AST structure for JSX/MDX content.Before:
Parsed as 3 siblings:
<Figure>,<div>,</Figure>After:
Parsed as parent-child:
<Figure>contains<div>as a childThis was a bug where the parser incorrectly treated JSX components as siblings when double-newlines were present between the tags. The fix ensures proper parent-child relationships match expected JSX/MDX semantics.
v9.3.5Compare Source
Patch Changes
08dfe8a: Fix regression: Tables within list items are now properly parsed.v9.3.4Compare Source
Patch Changes
c5b6259: Fixed URIError when parsing HTML attributes containing the % character (e.g.,width="100%"). The parser now gracefully handles invalid URI encodings in attribute values instead of throwing an error.v9.3.3Compare Source
Patch Changes
7ac3408: Restore angle-bracket autolinks when raw HTML parsing is disabled so<https://...>still renders as links7ac3408: Improve autolink parsing: stricter angle controls, domain underscore validation, and added coverage for mailto labels and raw-HTML-disabled cases.v9.3.2Compare Source
Patch Changes
a84c300: Ensure Solid renderer uses Solid's hyperscript runtime so JSX returns real elements instead of[object Object]placeholdersv9.3.1Compare Source
Patch Changes
c1b0ea2: Fix unintended node-specific code from entering browser bundles by changing build target from 'node' to 'browser'v9.3.0Compare Source
Minor Changes
a482de6: Add SolidJS integration with full JSX output support. Includes compiler, parser, astToJSX, and Markdown component with reactive support via signals/accessors.f9a8fca: Add Vue.js 3+ integration. Includescompiler,parser,astToJSX, andMarkdowncomponent. Vue uses standard HTML attributes (class, not className) with minimal attribute mapping (only 'for' -> 'htmlFor').Patch Changes
2bb3f2b: Fix AST and options mutation bugs that could cause unexpected side effects when using memoization or reusing objects across multiple compiler calls.v9.2.0Compare Source
Minor Changes
88d4b1f: Add comprehensive React Native support with new/nativeexport. Includes:img→Image, block elements (div,section,article,blockquote,ul,ol,li,table, etc.) →View, and inline elements →TextonLinkPressandonLinkLongPresscallbacks, defaulting toLinking.openURLNativeStyleKeytype system with styles for all markdown elements and HTML semantic tagsaccessibilityLabelfor images and proper link handlingNativeOptionsandNativeStyleKeytypesReact Native is an optional peer dependency, making this a zero-dependency addition for existing users.
v9.1.2Compare Source
Patch Changes
f93214a: Fix infinite recursion when usingforceBlock: truewith empty unclosed HTML tagsWhen
React.createElement(Markdown, {options: {forceBlock: true}}, '<var>')was called with an empty unclosed tag, it would cause infinite recursion. The parser would set thetextfield to the opening tag itself (e.g.,<var>), which would then be parsed again in the rendering phase, causing recursion.This fix adds detection in
createVerbatimHTMLBlockto detect whenforceBlockis used and the text contains just the opening tag (empty unclosed tag), rendering it as an empty element to prevent recursion.v9.1.1Compare Source
Patch Changes
733f10e: Fix lazy continuation lines for list items when continuation text appears at base indentation without a blank line. Previously, continuation text was incorrectly appended inline to the list item. Now both the existing inline content and the continuation text are properly wrapped in separate paragraphs.v9.1.0Compare Source
Minor Changes
0ba757d: AddpreserveFrontmatteroption to control whether YAML frontmatter is rendered in the output. When set totrue, frontmatter is rendered as a<pre>element in HTML/JSX output. For markdown-to-markdown compilation, frontmatter is preserved by default but can be excluded withpreserveFrontmatter: false.preserveFrontmatter: truepreserveFrontmatter: false<pre>elementPatch Changes
f945132: Fix lazy continuation lines for list items when continuation text appears at base indentation without a blank line before it. Previously, such lines were incorrectly parsed as separate paragraphs instead of being appended to the list item content.36ef089: yWork around a bundling bug with exporting TypeScript namespaces directly. Bonus: MarkdownToJSX is now declared ambiently so you may not need to import it.[
v9.0.0](https://redirect.github.com/quConfiguration
📅 Schedule: (UTC)
* 0-3 * * 1)🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.