UNPKG

@mentor-apm/react-sortable-tree

Version:

Drag-and-drop sortable component for nested data and hierarchies

14 lines (11 loc) 316 B
const visit = require('unist-util-visit') const {isComment, getCommentContents} = require('@mdx-js/util') module.exports = _options => tree => { visit(tree, 'jsx', node => { if (isComment(node.value)) { node.type = 'comment' node.value = getCommentContents(node.value) } }) return tree }