@silvenon/remark-smartypants
remark plugin to implement SmartyPants
Last updated 9 months ago by silvenon .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @silvenon/remark-smartypants 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (9 months ago)

4 Versions

  • 1.0.0                                ...           9 months ago
  • 0.1.2 [deprecated]           ...           9 months ago
  • 0.1.1                                ...           a year ago
  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 1
This Week 1
This Month 6
Last Day 0
Last Week 1
Last Month 26
Dependencies (3)
Dev Dependencies (4)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |