remark-lint plugin to ensure that your Markdown use curved quotes, apostrophes and hyphens/dashes.
npm install remark-lint-smarty-pants-typography
Use like any other remark-lint plugin. Check out the remark-lint documentation for details.
Some additional point to note:
The plugin formats the processed file if the flag --output
is not set. If you use this flag for general formatting of your documents, better use the plugin remark-smartypants
Under the hood the plugin uses retext-smartypants. Check out the retext-smartypants options for details.
When this rule is turned on, the content of the following example.md
:
He said, "A 'simple' english sentence..."
It's will be held from June 1-5. The statement -- if you ask me --- is quite remarkable...
Will be converted to the following content of example.md
:
He said, “A ‘simple’ english sentence…”
It’s will be held from June 1-5. The statement – if you ask me — is quite remarkable…
warning File has been overwritten smarty-pants-typography remark-lint
3:1-3:42 warning Smart typography was applied smarty-pants-typography remark-lint
5:1-5:91 warning Smart typography was applied smarty-pants-typography remark-lint
If you find this tool helpful, consider supporting us: