πŸš€ Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more β†’
Socket
Book a DemoInstallSign in
Socket

retext-smartypants

Package Overview
Dependencies
Maintainers
1
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

retext-smartypants

retext plugin to implement SmartyPants

6.2.0
latest
Source
npm
Version published
Weekly downloads
634K
-6.46%
Maintainers
1
Weekly downloads
Β 
Created

What is retext-smartypants?

The retext-smartypants package is a plugin for the retext ecosystem that transforms plain ASCII punctuation into typographically correct punctuation. It is useful for converting straight quotes to curly quotes, double hyphens to em dashes, and other similar transformations to improve the readability and appearance of text.

What are retext-smartypants's main functionalities?

Convert straight quotes to curly quotes

This feature converts straight quotes (" and ') to their curly counterparts (β€œ and ’).

const retext = require('retext');
const smartypants = require('retext-smartypants');
const report = require('vfile-reporter');

retext()
  .use(smartypants)
  .process('"Hello, world!" she said.', function (err, file) {
    if (err) throw err;
    console.log(String(file));
    console.error(report(file));
  });

Convert double hyphens to em dashes

This feature converts double hyphens (--) to em dashes (β€”).

const retext = require('retext');
const smartypants = require('retext-smartypants');
const report = require('vfile-reporter');

retext()
  .use(smartypants)
  .process('This is an example--with an em dash.', function (err, file) {
    if (err) throw err;
    console.log(String(file));
    console.error(report(file));
  });

Convert triple dots to ellipses

This feature converts triple dots (...) to ellipses (…).

const retext = require('retext');
const smartypants = require('retext-smartypants');
const report = require('vfile-reporter');

retext()
  .use(smartypants)
  .process('Wait... what?', function (err, file) {
    if (err) throw err;
    console.log(String(file));
    console.error(report(file));
  });

Other packages similar to retext-smartypants

Keywords

dashes

FAQs

Package last updated on 10 Oct 2024

Did you know?

Socket

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