curlyquotes
v1.5.5
Published
Applying curly quotes to your web page.
Downloads
3,269
Readme
curlyquotes
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.