Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

prevOpen Source→remark-typographynext

remark-typography0.8.1

Remark plugin to fix typography: quotes, dashes and so on.

Downloads per monthChangelogMIT Licenselibera manifesto
  • the top
  • Installation
  • Quick Take
  • Examples
  • IDEA
  • API
  • FEATURES
  • Changelog

Installation

Quick Take

Examples

  • Convert a three-dot ellipsis
  • Fix apostrophes following inline code nodes
  • Convert a multiplication marker
  • Convert straight quotes and apostrophes
  • Keep the last two words together
  • Convert a spaced dash

Idea

It’s an all-batteries-included Remark plugin to fix all typography in our English markdown texts.

Our competitor plugins say:

… it’s impossible to create one ideal typographic engine. It doesn’t work this way.

—Textr https://github.com/A/textropens in a new tab

I beg to differ. The modular system is overkill and books such as Oxford Grammar and Punctuationopens in a new tab define pretty clear and universal typesetting standards. Our typography plugin has only one requirement — the input text must be in English.

API

This package exports a default, fixTypography (you can change it to something else, it’s a default export). Use it like this:

unified().use(fixTypography)

There are no options (at least for now).

Features

This plugin corrects the following:

  • all kinds of apostrophesopens in a new tab, driven by string-apostrophes package
  • turns three dot sequences into ellipsesopens in a new tab (... into …)
  • converts certain hyphensopens in a new tab into em dashes (- into —)
  • widow wordsopens in a new tab, driven by string-remove-widows package

Coming soon:

  • en dashes (dashes between numbers)

This plugin is used on the codsen.com website.

Changelog

Open Changelog
↑ back to top
prev next

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab