Skip to content

v3.0.0

Compare
Choose a tag to compare
@github-actions github-actions released this 02 Oct 16:58
· 53 commits to main since this release

v2.1.3...v3.0.0

⚠️ Migrate from rehype-rewrite v2.x to v3.x.

rehype()
- .use(rehypeRewrite, (node, index, parent) => {})
+ .use(rehypeRewrite, {
+   rewrite: (node, index, parent) => {}
+ })

Options

import { Root, Element, ElementContent } from 'hast';
export declare type RehypeRewriteOptions = {
  selector?: string;
  rewrite(node: ElementContent, index: number | null, parent: Root | Element | null): void;
};

selector?: string;

Select an element to be wrapped. Expects a string selector that can be passed to hast-util-select (supported selectors). If selector is not set then wrap will check for a body all elements.

rewrite(node, index, parent): void;

Rewrite element.