rehype-budoux
v1.1.4
Published
rehype plugin to insert wbr using BudouX.
Downloads
4
Readme
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
Options
Configuration (TypeScript type).
Fields
className
?:string
|string[]
- Class name to be attached to the element into which the wbr element is inserted