Socket
Socket
Sign inDemoInstall

remark-smartypants

Package Overview
Dependencies
24
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remark-smartypants

remark plugin to implement SmartyPants


Version published
Weekly downloads
213K
decreased by-1.5%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

remark-smartypants

package version number of downloads

remark plugin to implement SmartyPants. Now with 100% more ESM!

Installing

# using npm
npm install remark-smartypants

# using yarn
yarn add remark-smartypants

Usage

Example using remark:

import remark from "remark";
import smartypants from "remark-smartypants";

const result = await remark().use(smartypants).process("# <<Hello World!>>");

console.log(String(result));
// # «Hello World!»

I created this plugin because I wanted to add SmartyPants to MDX:

import mdx from "@mdx-js/mdx";
import smartypants from "remark-smartypants";

const result = await mdx("# ---Hello World!---", {
  remarkPlugins: [smartypants],
});

Note that angle quotes in the former example (<<...>>) are probably impossible in MDX because there they are invalid syntax.

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

const result = await remark()
  .use(smartypants, { dashes: "oldschool" })
  .process("en dash (--), em dash (---)");

License

MIT License, Copyright (c) Matija Marohnić

Keywords

FAQs

Last updated on 15 Apr 2024

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