Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

typographic-quotes

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

typographic-quotes

Always use curly quotes

  • 1.0.4
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5.5K
decreased by-19.63%
Maintainers
1
Weekly downloads
 
Created
Source

typographic-quotes

NPM version Build Status Coveralls Status Dependency Status DevDependency Status

Always use curly quotes

Micro module to help eliminate one of the bad typewriter habits.

Install

npm install --save typographic-quotes

Usage

Use typographic quotes for your text with respect to your locale, basically for proper primary and secondary quotes. Pass locale as second parameter, default value is en-us. This module relies on typographic-quotes-l10n-db in choosing proper quotes for every language.

In American English, double quotes are used normally (the “primary” style). If quote marks are used inside another pair of quote marks, then single quotes are used as the “secondary” style. For example: “Didn't she say ‘I like red best’ when asked her favorite wine?” he wondered to himself.
— from the Wikipedia

var quotes = require('typographic-quotes');
// for american english (en-us) primary quotes are “”, and secondary are ‘’.
// for danish (da) primary quotes are »«, and secondary are ›‹.

quotes('foo \'foo\' bar');       // foo “foo” bar
quotes('foo \'foo\' bar', 'da'); // foo »foo« bar
quotes('foo "foo \'inside\' bar" bar');       // foo “foo ‘inside’ bar” bar
quotes('foo \'foo "inside" bar\' bar', 'da'); // foo »foo ›inside‹ bar« bar

Apostrophes

If you want to see proper apostrophes too, take a look at apostrophes and apostrophes-for-possessive-plurals typographic modules. Use first one before this module, second after: apostrophes → quotes → apostrophes-for-possessive-plurals. Check complex usage in typography playground.

License

MIT © Vladimir Starkov

Keywords

FAQs

Package last updated on 05 Apr 2015

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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc