Skip to content

Commit 3dffd6a

Browse files
committed
Update dependencies
1 parent 01b11fe commit 3dffd6a

6 files changed

+28
-34
lines changed

changelog.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Now (**fixed**):
7777
| - | - |
7878
| `blockquote` | `blockquote` |
7979
| `break` | `br` |
80-
| `code`, `inlineCode` | `code`, `pre`***** |
80+
| `code`, `inlineCode` | `code`, `pre`**\*** |
8181
| `definition` | **** |
8282
| `delete` | `del`**** |
8383
| `emphasis` | `em` |
@@ -88,7 +88,7 @@ Now (**fixed**):
8888
| `list` | `ol`, `ul`**** |
8989
| `listItem` | `li` |
9090
| `paragraph` | `p` |
91-
| `root` | ****** |
91+
| `root` | **\*\*** |
9292
| `strong` | `strong` |
9393
| `table` | `table`**** |
9494
| `tableHead` | `thead`**** |

lib/ast-to-react.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import React from 'react'
22
import ReactIs from 'react-is'
33
import {svg, find, hastToReact} from 'property-information'
4-
import spaces from 'space-separated-tokens'
5-
import commas from 'comma-separated-tokens'
4+
import {stringify as spaces} from 'space-separated-tokens'
5+
import {stringify as commas} from 'comma-separated-tokens'
66
import style from 'style-to-object'
77

88
/**
@@ -401,9 +401,9 @@ function addProperty(props, prop, value, ctx) {
401401

402402
// Accept `array`.
403403
// Most props are space-separated.
404-
if (result && typeof result === 'object' && 'length' in result) {
404+
if (Array.isArray(result)) {
405405
// type-coverage:ignore-next-line remove when typed.
406-
result = (info.commaSeparated ? commas : spaces).stringify(result)
406+
result = info.commaSeparated ? commas(result) : spaces(result)
407407
}
408408

409409
if (info.property === 'style' && typeof result === 'string') {

lib/react-markdown.js

+8-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
2-
import vfile from 'vfile'
3-
import unified from 'unified'
2+
import {VFile} from 'vfile'
3+
import {unified} from 'unified'
44
import parse from 'remark-parse'
55
import remarkRehype from 'remark-rehype'
66
import PropTypes from 'prop-types'
@@ -94,19 +94,14 @@ export function ReactMarkdown(options) {
9494
.use(options.rehypePlugins || [])
9595
.use(rehypeFilter, options)
9696

97-
/** @type {vfile} */
98-
let file
97+
let file = new VFile()
9998

10099
if (typeof options.children === 'string') {
101-
file = vfile(options.children)
102-
} else {
103-
if (options.children !== undefined && options.children !== null) {
104-
console.warn(
105-
`[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)`
106-
)
107-
}
108-
109-
file = vfile()
100+
file.value = options.children
101+
} else if (options.children !== undefined && options.children !== null) {
102+
console.warn(
103+
`[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)`
104+
)
110105
}
111106

112107
/** @type {Root} */

lib/rehype-filter.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import visit from 'unist-util-visit'
1+
import {visit} from 'unist-util-visit'
22

33
/**
44
* @typedef {import('unist').Node} Node

package.json

+12-13
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,17 @@
8181
"dependencies": {
8282
"@types/hast": "^2.0.0",
8383
"@types/unist": "^2.0.3",
84-
"comma-separated-tokens": "^1.0.0",
84+
"comma-separated-tokens": "^2.0.0",
8585
"prop-types": "^15.7.2",
8686
"property-information": "^6.0.0",
8787
"react-is": "^17.0.0",
88-
"remark-parse": "^9.0.0",
89-
"remark-rehype": "^8.0.0",
90-
"space-separated-tokens": "^1.1.0",
88+
"remark-parse": "^10.0.0",
89+
"remark-rehype": "^9.0.0",
90+
"space-separated-tokens": "^2.0.0",
9191
"style-to-object": "^0.3.0",
92-
"unified": "^9.0.0",
93-
"unist-util-visit": "^2.0.0",
94-
"vfile": "^4.0.0"
92+
"unified": "^10.0.0",
93+
"unist-util-visit": "^4.0.0",
94+
"vfile": "^5.0.0"
9595
},
9696
"peerDependencies": {
9797
"@types/react": ">=16",
@@ -108,16 +108,15 @@
108108
"eslint-plugin-react": "^7.0.0",
109109
"eslint-plugin-react-hooks": "^4.0.0",
110110
"eslint-plugin-security": "^1.0.0",
111-
"katex": "^0.13.0",
112111
"npm-run-all": "^4.0.0",
113112
"prettier": "^2.0.0",
114113
"react": "^17.0.0",
115114
"react-dom": "^17.0.0",
116-
"rehype-raw": "^5.0.0",
117-
"remark-cli": "^9.0.0",
118-
"remark-gfm": "^1.0.0",
119-
"remark-preset-wooorm": "^8.0.0",
120-
"remark-toc": "^7.0.0",
115+
"rehype-raw": "^6.0.0",
116+
"remark-cli": "^10.0.0",
117+
"remark-gfm": "^2.0.0",
118+
"remark-preset-wooorm": "^9.0.0",
119+
"remark-toc": "^8.0.0",
121120
"rimraf": "^3.0.0",
122121
"type-coverage": "^2.0.0",
123122
"typescript": "^4.0.0",

test/test.jsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import fs from 'fs'
44
import path from 'path'
55
import React from 'react'
66
import gfm from 'remark-gfm'
7-
import visit from 'unist-util-visit'
7+
import {visit} from 'unist-util-visit'
88
import raw from 'rehype-raw'
99
import toc from 'remark-toc'
1010
import ReactDom from 'react-dom/server.js'

0 commit comments

Comments
 (0)