# markdown-it-cjk-breaks

> Suppress linebreaks between east asian characters

Latest version **2.0.1** (published 2026-05-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdown-it-cjk-breaks
pnpm add markdown-it-cjk-breaks
yarn add markdown-it-cjk-breaks
bun add markdown-it-cjk-breaks
```

## Health

**Score 50/100 (C)** — status: active.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

## Facts

| | |
|---|---|
| Version | 2.0.1 |
| Published | 2026-05-19 |
| First published | 2018-02-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 32.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 23 |
| Maintainers | vitaly |
| Keywords | markdown-it-plugin, markdown-it |

## Links

- npm: https://www.npmjs.com/package/markdown-it-cjk-breaks
- Repository: https://github.com/markdown-it/markdown-it-cjk-breaks
- Homepage: https://github.com/markdown-it/markdown-it-cjk-breaks#readme
- Issues: https://github.com/markdown-it/markdown-it-cjk-breaks/issues
- npm.io page: https://npm.io/package/markdown-it-cjk-breaks

## Dependencies (1)

- [get-east-asian-width](https://npm.io/package/get-east-asian-width.md) ^1.2.0

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 2.0.1 (latest) — 2026-05-19
- 2.0.0 — 2023-12-05
- 1.1.3 — 2019-02-01
- 1.1.2 — 2018-11-27
- 1.1.1 — 2018-11-27
- 1.1.0 — 2018-02-26
- 1.0.0 — 2018-02-24

## README

# markdown-it-cjk-breaks

[![CI](https://github.com/markdown-it/markdown-it-cjk-breaks/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/markdown-it-cjk-breaks/actions/workflows/ci.yml)
[![NPM version](https://img.shields.io/npm/v/markdown-it-cjk-breaks.svg?style=flat)](https://www.npmjs.org/package/markdown-it-cjk-breaks)
[![Coverage Status](https://coveralls.io/repos/markdown-it/markdown-it-cjk-breaks/badge.svg?branch=master&service=github)](https://coveralls.io/github/markdown-it/markdown-it-cjk-breaks?branch=master)

> Plugin for [markdown-it](https://github.com/markdown-it/markdown-it) that suppresses linebreaks between east asian characters.

Normally newlines in a markdown text get rendered as newlines in output html text. Then browsers will usually render those newlines as whitespace (more smart behavior is included in w3c drafts, but not actually implemented by vendors).

This plugin finds and removes newlines that cannot be converted to space, algorithm matches [CSS Text Module Level 3](https://www.w3.org/TR/css-text-3/#line-break-transform):

 - If the character immediately before or immediately after the segment break is the zero-width space character (U+200B), then the break is removed, leaving behind the zero-width space.
 - Otherwise, if the East Asian Width property [UAX11] of both the character before and after the segment break is F, W, or H (not A), and neither side is Hangul, then the segment break is removed.
 - Otherwise, the segment break is converted to a space (U+0020).

## Install

```bash
yarn add markdown-it-cjk-breaks
```


## Usage

```js
var md = require('markdown-it')();
var cjk_breaks = require('markdown-it-cjk-breaks');

md.use(cjk_breaks);

md.render(`
あおえ
うい
aoe
ui
`);

// returns:
//
//<p>あおえうい
//aoe
//ui</p>
```


## License

[MIT](https://github.com/markdown-it/markdown-it-cjk-breaks/blob/master/LICENSE)

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