Installation
Quick Take
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/textr
I beg to differ. The modular system is overkill and books such as Oxford Grammar and Punctuation 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 apostrophes, driven by
string-apostrophes
package - turns three dot sequences into ellipses (
...
into…
) - converts certain hyphens into em dashes (
-
into—
) - widow words, driven by
string-remove-widows
package
Coming soon:
- en dashes (dashes between numbers)
This plugin is used on the codsen.com website.