1
- 'use strict'
2
-
3
- const React = require ( 'react' )
4
- const vfile = require ( 'vfile' )
5
- const unified = require ( 'unified' )
6
- const parse = require ( 'remark-parse' )
7
- const remarkRehype = require ( 'remark-rehype' )
8
- const PropTypes = require ( 'prop-types' )
9
- const html = require ( 'property-information/html' )
10
- const filter = require ( './rehype-filter.js' )
11
- const uriTransformer = require ( './uri-transformer.js' )
12
- const childrenToReact = require ( './ast-to-react.js' ) . hastChildrenToReact
1
+ import React from 'react'
2
+ import vfile from 'vfile'
3
+ import unified from 'unified'
4
+ import parse from 'remark-parse'
5
+ import remarkRehype from 'remark-rehype'
6
+ import PropTypes from 'prop-types'
7
+ import { html } from 'property-information'
8
+ import rehypeFilter from './rehype-filter.js'
9
+ import { uriTransformer } from './uri-transformer.js'
10
+ import { childrenToReact } from './ast-to-react.js'
13
11
14
12
/**
15
13
* @typedef {import('react').ReactNode } ReactNode
@@ -33,8 +31,6 @@ const childrenToReact = require('./ast-to-react.js').hastChildrenToReact
33
31
* @typedef {CoreOptions & PluginOptions & LayoutOptions & FilterOptions & TransformOptions } ReactMarkdownOptions
34
32
*/
35
33
36
- module . exports = ReactMarkdown
37
-
38
34
const own = { } . hasOwnProperty
39
35
const changelog =
40
36
'https://github.com/remarkjs/react-markdown/blob/main/changelog.md'
@@ -76,7 +72,7 @@ const deprecated = {
76
72
* @param {ReactMarkdownOptions } options
77
73
* @returns {ReactElement }
78
74
*/
79
- function ReactMarkdown ( options ) {
75
+ export function ReactMarkdown ( options ) {
80
76
for ( const key in deprecated ) {
81
77
if ( own . call ( deprecated , key ) && own . call ( options , key ) ) {
82
78
/** @type {Deprecation } */
@@ -96,7 +92,7 @@ function ReactMarkdown(options) {
96
92
. use ( options . remarkPlugins || options . plugins || [ ] )
97
93
. use ( remarkRehype , { allowDangerousHtml : true } )
98
94
. use ( options . rehypePlugins || [ ] )
99
- . use ( filter , options )
95
+ . use ( rehypeFilter , options )
100
96
101
97
/** @type {vfile } */
102
98
let file
0 commit comments