This package has been deprecated

Author message:

renamed to just "remark-smartypants"

@silvenon/remark-smartypants
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

@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()
  .use(smartypants)
  .processSync('# "Hello World!"')

console.log(String(content))
// # “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: [
    smartypants,
  ],
})

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 (---)')

Package Sidebar

Install

npm i @silvenon/remark-smartypants

Weekly Downloads

2,000

Version

2.0.0

License

MIT

Unpacked Size

4.66 kB

Total Files

5

Last publish

Collaborators

  • silvenon