Course lesson

Remove Markdown Nodes from a Document with unist-util-remove

When using remark to manipulate markdown documents, you can use unist-util-remove to remove nodes of a particular type. You can combine it with unist-util-visit to remove nodes based on their parent's context in the AST.

Duration
1 min
Access
Free
Transcript
Available

When using remark to manipulate markdown documents, you can use unist-util-remove to remove nodes of a particular type. You can combine it with unist-util-visit to remove nodes based on their parent's context in the AST.

In this example, we remove all images contained within heading nodes.