Skip to content

Commit c383a45

Browse files
committed
Update @types/hast, utilities, plugins, etc
1 parent 107c8ba commit c383a45

File tree

5 files changed

+21
-20
lines changed

5 files changed

+21
-20
lines changed

lib/ast-to-react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* @typedef {import('hast').Root} Root
1717
* @typedef {import('hast').Text} Text
1818
* @typedef {import('hast').Comment} Comment
19-
* @typedef {import('hast').DocType} Doctype
19+
* @typedef {import('hast').Doctype} Doctype
2020
* @typedef {import('property-information').Info} Info
2121
* @typedef {import('property-information').Schema} Schema
2222
* @typedef {import('./complex-types.js').ReactMarkdownProps} ReactMarkdownProps

package.json

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,21 @@
7979
"react-markdown.min.js"
8080
],
8181
"dependencies": {
82-
"@types/hast": "^2.0.0",
82+
"@types/hast": "^3.0.0",
8383
"@types/prop-types": "^15.0.0",
84-
"@types/unist": "^2.0.0",
84+
"@types/unist": "^3.0.0",
8585
"comma-separated-tokens": "^2.0.0",
86-
"hast-util-whitespace": "^2.0.0",
86+
"hast-util-whitespace": "^3.0.0",
8787
"prop-types": "^15.0.0",
8888
"property-information": "^6.0.0",
8989
"react-is": "^18.0.0",
90-
"remark-parse": "^10.0.0",
91-
"remark-rehype": "^10.0.0",
90+
"remark-parse": "^11.0.0",
91+
"remark-rehype": "^11.0.0",
9292
"space-separated-tokens": "^2.0.0",
9393
"style-to-object": "^0.4.0",
94-
"unified": "^10.0.0",
95-
"unist-util-visit": "^4.0.0",
96-
"vfile": "^5.0.0"
94+
"unified": "^11.0.0",
95+
"unist-util-visit": "^5.0.0",
96+
"vfile": "^6.0.0"
9797
},
9898
"peerDependencies": {
9999
"@types/react": ">=16",
@@ -114,11 +114,11 @@
114114
"prettier": "^3.0.0",
115115
"react": "^18.0.0",
116116
"react-dom": "^18.0.0",
117-
"rehype-raw": "^6.0.0",
117+
"rehype-raw": "^7.0.0",
118118
"remark-cli": "^11.0.0",
119-
"remark-gfm": "^3.0.0",
119+
"remark-gfm": "^4.0.0",
120120
"remark-preset-wooorm": "^9.0.0",
121-
"remark-toc": "^8.0.0",
121+
"remark-toc": "^9.0.0",
122122
"type-coverage": "^2.0.0",
123123
"typescript": "^5.0.0",
124124
"xo": "^0.56.0"
@@ -143,7 +143,7 @@
143143
"plugins": [
144144
"remark-preset-wooorm",
145145
[
146-
"remark-gfm",
146+
"./node_modules/remark-preset-wooorm/node_modules/remark-gfm/index.js",
147147
{
148148
"tablePipeAlign": false
149149
}

test/fixtures/runthrough.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ <h2>HTML entities</h2>
152152
<p>Some characters, like æ, &amp; and similar should be handled properly.</p>
153153
<h2>HTML</h2>
154154
<p>Does anyone actually like the fact that you can embed HTML in markdown?</p>
155-
<iframe src="https://foo.bar/" width="640" height="480">
156-
We used to have a known bug where inline HTML wasn&#x27;t handled well. You can do basic tags like
157-
code</iframe>, as long as it doesn&#x27;t contain any <span class="attrs">attributes</span>. If you
155+
<iframe src="https://foo.bar/" width="640" height="480"></iframe>
156+
<p>We used to have a known bug where inline HTML wasn&#x27;t handled well. You can do basic tags like
157+
<code>code</code>, as long as it doesn&#x27;t contain any <span class="attrs">attributes</span>. If you
158158
have weird ordering on your tags, it won&#x27;t work either. It does support <strong>nested
159-
<em>tags</em>, however</strong>. And with the <code class="name">rehype-raw</code> plugin, it can now properly handle HTML! Which is pretty sweet.<p></p>
159+
<em>tags</em>, however</strong>. And with the <code class="name">rehype-raw</code> plugin, it can now properly handle HTML! Which is pretty sweet.</p>
160160
<hr/><hr/>
161161
<p>Cool, eh?</p>

test/fixtures/runthrough.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ Does anyone actually like the fact that you can embed HTML in markdown?
159159
src="https://foo.bar/"
160160
width="640"
161161
height="480"
162-
/>
162+
></iframe>
163163
164164
We used to have a known bug where inline HTML wasn't handled well. You can do basic tags like
165165
<code>code</code>, as long as it doesn't contain any <span class="attrs">attributes</span>. If you

test/test.jsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -835,7 +835,7 @@ test('should render footnote with custom options', () => {
835835
remarkRehypeOptions={{clobberPrefix: 'main-'}}
836836
/>
837837
),
838-
'<p>This is a statement<sup><a href="#main-fn-1" id="main-fnref-1" data-footnote-ref="true" aria-describedby="footnote-label">1</a></sup> with a citation.</p>\n<section data-footnotes="true" class="footnotes"><h2 class="sr-only" id="footnote-label">Footnotes</h2>\n<ol>\n<li id="main-fn-1">\n<p>This is a footnote for the citation. <a href="#main-fnref-1" data-footnote-backref="true" class="data-footnote-backref" aria-label="Back to content">↩</a></p>\n</li>\n</ol>\n</section>'
838+
'<p>This is a statement<sup><a href="#main-fn-1" id="main-fnref-1" data-footnote-ref="true" aria-describedby="footnote-label">1</a></sup> with a citation.</p>\n<section data-footnotes="true" class="footnotes"><h2 class="sr-only" id="footnote-label">Footnotes</h2>\n<ol>\n<li id="main-fn-1">\n<p>This is a footnote for the citation. <a href="#main-fnref-1" data-footnote-backref="" aria-label="Back to reference 1" class="data-footnote-backref">↩</a></p>\n</li>\n</ol>\n</section>'
839839
)
840840
})
841841

@@ -1155,9 +1155,10 @@ test('should render table of contents plugin', () => {
11551155
const actual = asHtml(
11561156
<Markdown children={input} remarkPlugins={[remarkToc]} />
11571157
)
1158+
11581159
assert.equal(
11591160
actual,
1160-
'<h1>Header</h1>\n<h2>Table of Contents</h2>\n<ul>\n<li>\n<p><a href="#first-section">First Section</a></p>\n</li>\n<li>\n<p><a href="#second-section">Second Section</a></p>\n<ul>\n<li><a href="#subsection">Subsection</a></li>\n</ul>\n</li>\n<li>\n<p><a href="#third-section">Third Section</a></p>\n</li>\n</ul>\n<h2>First Section</h2>\n<h2>Second Section</h2>\n<h3>Subsection</h3>\n<h2>Third Section</h2>'
1161+
'<h1>Header</h1>\n<h2>Table of Contents</h2>\n<ul>\n<li><a href="#first-section">First Section</a></li>\n<li><a href="#second-section">Second Section</a>\n<ul>\n<li><a href="#subsection">Subsection</a></li>\n</ul>\n</li>\n<li><a href="#third-section">Third Section</a></li>\n</ul>\n<h2>First Section</h2>\n<h2>Second Section</h2>\n<h3>Subsection</h3>\n<h2>Third Section</h2>'
11611162
)
11621163
})
11631164

0 commit comments

Comments
 (0)