Skip to content

Releases: jaywcjlove/rehype-rewrite

v4.0.2

26 Nov 11:18
Compare
Choose a tag to compare

v4.0.1

25 Nov 11:35
Compare
Choose a tag to compare

Documentation v4.0.1: https://raw.githack.com/jaywcjlove/rehype-rewrite/da871de/index.html
Comparing Changes: v4.0.0...v4.0.1

v4.0.0

28 Sep 05:38
Compare
Choose a tag to compare

Documentation v4.0.0: https://raw.githack.com/jaywcjlove/rehype-rewrite/490303d/index.html
Comparing Changes: v3.0.6...v4.0.0

v3.0.6

14 Mar 03:56
Compare
Choose a tag to compare

Documentation v3.0.6: https://raw.githack.com/jaywcjlove/rehype-rewrite/e138d83/index.html
Comparing Changes: v3.0.5...v3.0.6

v3.0.5

05 Mar 19:05
Compare
Choose a tag to compare

Documentation v3.0.5: https://raw.githack.com/jaywcjlove/rehype-rewrite/d0a8b84/index.html
Comparing Changes: v3.0.4...v3.0.5

v3.0.4

05 Oct 19:18
Compare
Choose a tag to compare

v3.0.3...v3.0.4

v3.0.3

05 Oct 18:35
Compare
Choose a tag to compare

v3.0.2...v3.0.3

v3.0.2

04 Oct 19:32
Compare
Choose a tag to compare

v3.0.1...v3.0.2

Options

import { Plugin } from 'unified';
import { Root, Element, RootContent } from 'hast';
export declare type RehypeRewriteOptions = {
  /**
   * Select an element to be wrapped. Expects a string selector that can be passed to hast-util-select ([supported selectors](https://github.com/syntax-tree/hast-util-select/blob/master/readme.md#support)).
   * If `selector` is not set then wrap will check for a body all elements.
   */
  selector?: string;
  /** Rewrite Element. */
  rewrite(node: Root | RootContent, index: number | null, parent: Root | Element | null): void;
};
declare const remarkRewrite: Plugin<[RehypeRewriteOptions?], Root>;
export default remarkRewrite;

v3.0.1

04 Oct 16:55
Compare
Choose a tag to compare

v3.0.0...v3.0.1

v3.0.0

02 Oct 16:58
Compare
Choose a tag to compare

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.