rsuite-theme
Version:
The suite theme for pagurian
78 lines (49 loc) • 1.89 kB
Markdown
Remove [`position`][position]s from a [Unist][] tree.
[][]:
```bash
npm install unist-util-remove-position
```
```javascript
var remark = require('remark');
var removePosition = require('unist-util-remove-position');
var tree = remark().parse('Some _emphasis_, **importance**, and `code`.');
console.dir(removePosition(tree, true), {depth: null});
```
Yields:
```js
{ type: 'root',
children:
[ { type: 'paragraph',
children:
[ { type: 'text', value: 'Some ' },
{ type: 'emphasis',
children: [ { type: 'text', value: 'emphasis' } ] },
{ type: 'text', value: ', ' },
{ type: 'strong',
children: [ { type: 'text', value: 'importance' } ] },
{ type: 'text', value: ', and ' },
{ type: 'inlineCode', value: 'code' },
{ type: 'text', value: '.' } ] } ] }
```
Remove [`position`][position]s from [`node`][node]. If `force` is given,
uses `delete`, otherwise, sets `position`s to `undefined`.
The given `node`.
[][license] © [Titus Wormer][author]
<!-- Definitions -->
[]: https://img.shields.io/travis/syntax-tree/unist-util-remove-position.svg
[]: https://travis-ci.org/syntax-tree/unist-util-remove-position
[]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg
[]: https://codecov.io/github/syntax-tree/unist-util-remove-position
[]: https://docs.npmjs.com/cli/install
[]: LICENSE
[]: http://wooorm.com
[]: https://github.com/syntax-tree/unist
[]: https://github.com/syntax-tree/unist#position
[]: https://github.com/syntax-tree/unist#node