remark plugin to implement SmartyPants

Usage no npm install needed!

<script type="module">
  import silvenonRemarkSmartypants from 'https://cdn.skypack.dev/@silvenon/remark-smartypants';



remark plugin to implement SmartyPants.

npm install @silvenon/remark-smartypants
const remark = require('remark')
const smartypants = require('@silvenon/remark-smartypants')

const content = remark()
  .processSync('# "Hello World!"')

// # “Hello World!”
// (notice smart quotes)

"Why?" I hear nobody ask. Because I wanted to implement SmartyPants in MDX:

const mdx = require('@mdx-js/mdx')
const smartypants = require('@silvenon/remark-smartypants')

// let's pretend that support for top-level async/await exists...
const result = await mdx('# "Hello World!"', {
  remarkPlugins: [

This plugin uses retext-smartypants under the hood, so it takes the same options:

const content = remark()
  .use(smartypants, { dashes: 'oldschool' })
  .processSync('en dash (--), em dash (---)')