Socket
Socket
Sign inDemoInstall

@silvenon/remark-smartypants

Package Overview
Dependencies
24
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @silvenon/remark-smartypants

remark plugin to implement SmartyPants


Version published
Weekly downloads
2.5K
increased by10.62%
Maintainers
1
Install size
498 kB
Created
Weekly downloads
 

Readme

Source

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

Keywords

FAQs

Last updated on 21 Nov 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc