# posthtml-typograf

> PostHTML plugin for typograf

Latest version **0.0.5** (published 2025-09-03) · 0 weekly downloads

## Install

```sh
npm install posthtml-typograf
pnpm add posthtml-typograf
yarn add posthtml-typograf
bun add posthtml-typograf
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2025-09-03 |
| First published | 2023-03-22 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | efiand |

## Links

- npm: https://www.npmjs.com/package/posthtml-typograf
- npm.io page: https://npm.io/package/posthtml-typograf

## Dependencies (3)

- [typograf](https://npm.io/package/typograf.md) 7.4.4
- [posthtml-parser](https://npm.io/package/posthtml-parser.md) 0.12.1
- [posthtml-render](https://npm.io/package/posthtml-render.md) 3.0.0

## Recent versions

- 0.0.5 (latest) — 2025-09-03
- 0.0.4 — 2025-07-21
- 0.0.3 — 2025-07-21
- 0.0.2 — 2025-07-21
- 0.0.1 — 2023-03-22

## README

# posthtml-typograf [![npm version](https://img.shields.io/npm/v/posthtml-typograf.svg)](https://www.npmjs.com/package/posthtml-typograf)

PostHTML-плагин для [typograf](https://www.npmjs.com/package/typograf).

## Установка

`npm i -E posthtml-typograf`

## Использование в произвольном коде

```js
import { typografy } from "posthtml-typograf";

// Где-то внутри middleware, получившей HTML-код:
typografy(oldHTML, ["ru/other/phone-number"]);
```

`typografy` принимает три аргумента (обязателен только первый из них):

1. Обрабатываемый HTML-код.

2. Отключаемые [правила](https://github.com/typograf/typograf/blob/HEAD/docs/RULES.ru.md) - массив (по умолчанию пустой).

3. Опции типографа - объект (по умолчанию пустой), свойствами которого можно переопределить следующие предустановки плагиина:

   ```json
   {
     "locale": ["ru", "en-US"],
     "htmlEntity": { "type": "name" }
   }
   ```

## Использование в posthtml.config.js

```js
import { getPosthtmlTypograf } from "posthtml-typograf";

export default () => ({
  plugins: [
    // other PostHTML plugins
    getPosthtmlTypograf(["ru/other/phone-number"]),
  ],
});
```

`getPosthtmlTypograf` принимает два аргумента:

1. Отключаемые [правила](https://github.com/typograf/typograf/blob/HEAD/docs/RULES.ru.md) - массив (по умолчанию пустой).

2. Опции типографа - объект (по умолчанию пустой), свойствами которого можно переопределить предустановки плагиина.

---
_Source: https://npm.io/package/posthtml-typograf · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
