# typographic-em-dash

> Micro module to fix a common typographic issue that is hard to fix with most keyboard layouts.

Latest version **1.0.17** (published 2024-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install typographic-em-dash
pnpm add typographic-em-dash
yarn add typographic-em-dash
bun add typographic-em-dash
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.17 |
| Published | 2024-04-27 |
| First published | 2017-06-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 237 |
| Author | Victor Felder |
| Maintainers | situphen, talone |
| Keywords | textr |

## Links

- npm: https://www.npmjs.com/package/typographic-em-dash
- Repository: https://github.com/zestedesavoir/zmarkdown.git#master
- Homepage: https://github.com/zestedesavoir/zmarkdown/tree/master#readme
- Issues: https://github.com/zestedesavoir/zmarkdown/issues
- npm.io page: https://npm.io/package/typographic-em-dash

## Recent versions

- 1.0.17 (latest) — 2024-04-27
- 1.0.16 — 2021-02-14
- 1.0.15 — 2020-02-03
- 1.0.14 — 2019-07-27
- 1.0.13 — 2019-04-14
- 1.0.12 — 2019-02-04
- 1.0.11 — 2018-11-23
- 1.0.10 — 2018-10-04
- 1.0.9 — 2018-07-20
- 1.0.8 — 2018-03-06
- 1.0.7 — 2018-01-20
- 1.0.6 — 2018-01-13
- 1.0.5 — 2017-08-31
- 1.0.4 — 2017-08-25
- 1.0.3 — 2017-08-16
- … 9 more at https://npm.io/package/typographic-em-dash/versions

## README

# typographic-em-dash [![Build Status][build-badge]][build-status] [![Coverage Status][coverage-badge]][coverage-status]

Micro module to fix a common typographic issue that is hard to fix with most keyboard layouts.

This is mainly meant for French typography, it replaces _--_ by an _em dash_ ([en](http://www.fileformat.info/info/unicode/char/2014/index.htm), [fr](https://fr.wikipedia.org/wiki/Cadratin)). If the locale is French and we have a pair like _— foo —_, the first space after the first em dash and the space preceding the second dash will be a _narrow no-break space_ ([en](http://www.fileformat.info/info/unicode/char/202f/index.htm), [fr](https://fr.wikipedia.org/wiki/Espace_fine_ins%C3%A9cable)).

Submit a PR to `src/db.js` to add support for your locale.

## Install

[npm][npm]:

```sh
npm install --save typographic-em-dash
```


## Usage

```js
var dash = require('typographic-em-dash')

dash(`--foo--`, { locale: 'fr' })
// will be replaced by —foo—
dash(`-- foo --`, { locale: 'fr' })
// will be replaced by —NNBSfooNNBs— where NNBS is a narrow no-break space
dash(`--foo--`, { locale: 'en' })
// will be replaced by —foo—
dash(`-- foo --`, { locale: 'en' })
// will be replaced by — foo —
```

This module can also be used through [textr][textr].

## License

[MIT][license] © [Zeste de Savoir][zds]

<!-- Definitions -->

[build-badge]: https://img.shields.io/travis/zestedesavoir/zmarkdown.svg

[build-status]: https://travis-ci.org/zestedesavoir/zmarkdown

[coverage-badge]: https://img.shields.io/coveralls/zestedesavoir/zmarkdown.svg

[coverage-status]: https://coveralls.io/github/zestedesavoir/zmarkdown

[license]: https://github.com/zestedesavoir/zmarkdown/blob/master/packages/typographic-em-dash/LICENSE-MIT

[zds]: https://zestedesavoir.com

[npm]: https://www.npmjs.com/package/typographic-em-dash

[textr]: https://github.com/A/text

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