Skip to content

Commit

Permalink
Add a dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
wooorm committed Oct 18, 2023
1 parent f5ad968 commit dcabd6d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
3 changes: 1 addition & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/mdx/lib/plugin/remark-mark-and-unravel.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* @typedef {import('mdast').RootContent} RootContent
*/

import {collapseWhiteSpace} from 'collapse-white-space'
import {visit} from 'unist-util-visit'

/**
Expand Down Expand Up @@ -41,8 +42,7 @@ export function remarkMarkAndUnravel() {
oneOrMore = true
} else if (
child.type === 'text' &&
// To do: use `collapse-whitespace`?
/^[\t\r\n ]+$/.test(String(child.value))
collapseWhiteSpace(child.value, {style: 'html', trim: true}) === ''
) {
// Empty.
} else {
Expand Down
2 changes: 1 addition & 1 deletion packages/mdx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"@types/estree-jsx": "^1.0.0",
"@types/hast": "^3.0.0",
"@types/mdx": "^2.0.0",
"collapse-white-space": "^2.0.0",
"devlop": "^1.0.0",
"estree-util-build-jsx": "^3.0.0",
"estree-util-is-identifier-name": "^3.0.0",
Expand All @@ -67,7 +68,6 @@
"unist-util-visit": "^5.0.0",
"vfile": "^6.0.0"
},
"devDependencies": {},
"scripts": {
"test": "npm run test-coverage",
"test-api": "node --conditions development --enable-source-maps test/index.js",
Expand Down

0 comments on commit dcabd6d

Please sign in to comment.