1.0.0 • Published 23 days ago

rehype-budoux v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
23 days ago

rehype-budoux

About

rehype plugin to insert wbr using BudouX.

Installation

npm install rehype-budoux
yarn add rehype-budoux
pnpm install rehype-budoux
bun add rehype-budoux

Usage

import { rehype } from "rehype";
import rehypeBudouX from "rehype-budoux";

const result = await rehype()
  .data("settings", {
    fragment: true
  })
  .use(rehypeBudouX, {
    className: "budoux-breaked"
  })
  .process("<p>こんにちは、世界!</p>");

// -> <p class="budoux-breaked">こんに<wbr>ちは、<wbr>世界!</p>
console.log(result.toString());

API

Document

Options

Configuration (TypeScript type).

Fields

  • className?: string | string[] - Class name to be attached to the element into which the wbr element is inserted
1.0.0

23 days ago