Cleanup Confluence HTML via rehype
# npm
npm i -g cf-cleaner
# pnpm
pnpm i -g cf-cleaner
# yarn
yarn global add cf-cleaner
Usage: cfc [options] [input]
Arguments:
input Input HTML codes
Options:
-V, --version output the version number
-i, --input <path> Input HTML file
-o, --output <path> Output HTML file
-m, --minify [boolean] Whether to minify HTML output
-h, --help display help for command
import fs from 'fs'
import { cleaner } from 'cf-cleaner'
// string
const output = cleaner(html, minify, encoding)
// stream
cleaner(fs.createReadStream(htmlFile), minify).pipe(
fs.createWriteStream(outputFile),
)
Detailed changes for each release are documented in CHANGELOG.md.