curlyquotes
TypeScript icon, indicating that this package has built-in type declarations

1.5.5 • Public • Published

curlyquotes

dependency status devDependency status build status npm version

Dynamically apply smart curly quotes to your web page.

yarn add curlyquotes
import * as curlyquotes from "curlyquotes"
curlyquotes.observe()

The code snippet above will detect all straight quotes and convert them to smart versions, and will continue to observe changes in the DOM tree and apply the changes.

Usage

DOM

Notes: The following three DOM methods of curlyquotes accept an optional Node, which falls back to document.body if omitted.

/**
 * Recursively walk through and convert all child nodes
 * of `rootNode`.
 */
export function init(rootNode?: Node): void
 
/** Starts observing the `node`. */
export function observe(node?: Node): void
 
/** Stops all observations started by `observe` to `node`. */
export function disconnect(node?: Node): void
 
/** Provide a CSS selector used to ignore matched nodes. */
export function ignore(selector: string): void
 
/** Returns a new string with smartquotes applied. */
export function string(source: string): string

Supported Browsers

The latest three versions of all evergreen browsers.

License

BSD 3 Clause

Readme

Keywords

Package Sidebar

Install

npm i curlyquotes

Weekly Downloads

962

Version

1.5.5

License

BSD-3-Clause

Unpacked Size

19.9 kB

Total Files

17

Last publish

Collaborators

  • proteria