Skip to content

Commit b83ec5f

Browse files
committed
Fix to reexport Raw from mdast-util-to-hast
Previously a new raw was exposed, which was a different interface than the one from `mdast-util-to-hast`. That can be considered the canonical place where this extension comes from, so defer to that.
1 parent e66705a commit b83ec5f

File tree

3 files changed

+3
-23
lines changed

3 files changed

+3
-23
lines changed

index.d.ts

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,3 @@
1-
import type {Literal} from 'hast'
2-
1+
export type {Raw} from 'mdast-util-to-hast'
32
export type {Options} from './lib/index.js'
43
export {raw} from './lib/index.js'
5-
6-
/* eslint-disable @typescript-eslint/consistent-type-definitions */
7-
8-
export interface Raw extends Literal {
9-
type: 'raw'
10-
}
11-
12-
// Add `Raw` nodes to roots and elements.
13-
declare module 'hast' {
14-
interface RootContentMap {
15-
raw: Raw
16-
}
17-
18-
interface ElementContentMap {
19-
raw: Raw
20-
}
21-
}
22-
23-
/* eslint-enable @typescript-eslint/consistent-type-definitions */

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* @typedef {import('hast').Comment} Comment
1919
* @typedef {import('hast').Content} Content
2020
*
21-
* @typedef {import('../index.js').Raw} Raw
21+
* @typedef {import('mdast-util-to-hast').Raw} Raw
2222
*/
2323

2424
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
"hast-util-from-parse5": "^7.0.0",
4040
"hast-util-to-parse5": "^7.0.0",
4141
"html-void-elements": "^2.0.0",
42+
"mdast-util-to-hast": "^12.0.0",
4243
"parse5": "^7.0.0",
4344
"unist-util-position": "^4.0.0",
4445
"unist-util-visit": "^4.0.0",
@@ -52,7 +53,6 @@
5253
"hast-util-to-html": "^8.0.0",
5354
"hastscript": "^7.0.0",
5455
"mdast-util-from-markdown": "^1.0.0",
55-
"mdast-util-to-hast": "^12.0.0",
5656
"prettier": "^2.0.0",
5757
"remark-cli": "^11.0.0",
5858
"remark-preset-wooorm": "^9.0.0",

0 commit comments

Comments
 (0)