Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Aug 13, 2021
1 parent 01b11fe commit 3dffd6a
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 34 deletions.
4 changes: 2 additions & 2 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ Now (**fixed**):
| - | - |
| `blockquote` | `blockquote` |
| `break` | `br` |
| `code`, `inlineCode` | `code`, `pre`***** |
| `code`, `inlineCode` | `code`, `pre`**\*** |
| `definition` | **** |
| `delete` | `del`**** |
| `emphasis` | `em` |
Expand All @@ -88,7 +88,7 @@ Now (**fixed**):
| `list` | `ol`, `ul`**** |
| `listItem` | `li` |
| `paragraph` | `p` |
| `root` | ****** |
| `root` | **\*\*** |
| `strong` | `strong` |
| `table` | `table`**** |
| `tableHead` | `thead`**** |
Expand Down
8 changes: 4 additions & 4 deletions lib/ast-to-react.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from 'react'
import ReactIs from 'react-is'
import {svg, find, hastToReact} from 'property-information'
import spaces from 'space-separated-tokens'
import commas from 'comma-separated-tokens'
import {stringify as spaces} from 'space-separated-tokens'
import {stringify as commas} from 'comma-separated-tokens'
import style from 'style-to-object'

/**
Expand Down Expand Up @@ -401,9 +401,9 @@ function addProperty(props, prop, value, ctx) {

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

if (info.property === 'style' && typeof result === 'string') {
Expand Down
21 changes: 8 additions & 13 deletions lib/react-markdown.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react'
import vfile from 'vfile'
import unified from 'unified'
import {VFile} from 'vfile'
import {unified} from 'unified'
import parse from 'remark-parse'
import remarkRehype from 'remark-rehype'
import PropTypes from 'prop-types'
Expand Down Expand Up @@ -94,19 +94,14 @@ export function ReactMarkdown(options) {
.use(options.rehypePlugins || [])
.use(rehypeFilter, options)

/** @type {vfile} */
let file
let file = new VFile()

if (typeof options.children === 'string') {
file = vfile(options.children)
} else {
if (options.children !== undefined && options.children !== null) {
console.warn(
`[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)`
)
}

file = vfile()
file.value = options.children
} else if (options.children !== undefined && options.children !== null) {
console.warn(
`[react-markdown] Warning: please pass a string as \`children\` (not: \`${options.children}\`)`
)
}

/** @type {Root} */
Expand Down
2 changes: 1 addition & 1 deletion lib/rehype-filter.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import visit from 'unist-util-visit'
import {visit} from 'unist-util-visit'

/**
* @typedef {import('unist').Node} Node
Expand Down
25 changes: 12 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@
"dependencies": {
"@types/hast": "^2.0.0",
"@types/unist": "^2.0.3",
"comma-separated-tokens": "^1.0.0",
"comma-separated-tokens": "^2.0.0",
"prop-types": "^15.7.2",
"property-information": "^6.0.0",
"react-is": "^17.0.0",
"remark-parse": "^9.0.0",
"remark-rehype": "^8.0.0",
"space-separated-tokens": "^1.1.0",
"remark-parse": "^10.0.0",
"remark-rehype": "^9.0.0",
"space-separated-tokens": "^2.0.0",
"style-to-object": "^0.3.0",
"unified": "^9.0.0",
"unist-util-visit": "^2.0.0",
"vfile": "^4.0.0"
"unified": "^10.0.0",
"unist-util-visit": "^4.0.0",
"vfile": "^5.0.0"
},
"peerDependencies": {
"@types/react": ">=16",
Expand All @@ -108,16 +108,15 @@
"eslint-plugin-react": "^7.0.0",
"eslint-plugin-react-hooks": "^4.0.0",
"eslint-plugin-security": "^1.0.0",
"katex": "^0.13.0",
"npm-run-all": "^4.0.0",
"prettier": "^2.0.0",
"react": "^17.0.0",
"react-dom": "^17.0.0",
"rehype-raw": "^5.0.0",
"remark-cli": "^9.0.0",
"remark-gfm": "^1.0.0",
"remark-preset-wooorm": "^8.0.0",
"remark-toc": "^7.0.0",
"rehype-raw": "^6.0.0",
"remark-cli": "^10.0.0",
"remark-gfm": "^2.0.0",
"remark-preset-wooorm": "^9.0.0",
"remark-toc": "^8.0.0",
"rimraf": "^3.0.0",
"type-coverage": "^2.0.0",
"typescript": "^4.0.0",
Expand Down
2 changes: 1 addition & 1 deletion test/test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import fs from 'fs'
import path from 'path'
import React from 'react'
import gfm from 'remark-gfm'
import visit from 'unist-util-visit'
import {visit} from 'unist-util-visit'
import raw from 'rehype-raw'
import toc from 'remark-toc'
import ReactDom from 'react-dom/server.js'
Expand Down

0 comments on commit 3dffd6a

Please sign in to comment.