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

mdast-util-to-string

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mdast-util-to-string - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

13

history.md

@@ -1,5 +0,16 @@

<!--mdast setext-->
<!--remark setext-->
<!--lint disable no-multiple-toplevel-headings-->
1.0.1 / 2016-01-17
==================
* Refactor `readme.md` ([`22f132a`](https://github.com/wooorm/mdast-util-to-string/commit/22f132a))
* Remove support for `Component` ([`f86478e`](https://github.com/wooorm/mdast-util-to-string/commit/f86478e))
* Remove support for bower ([`8cc65c9`](https://github.com/wooorm/mdast-util-to-string/commit/8cc65c9))
* Add node 4.0, node 5.0 to Travis test targets ([`747fb01`](https://github.com/wooorm/mdast-util-to-string/commit/747fb01))
* Refactor npm test target ([`fd6769c`](https://github.com/wooorm/mdast-util-to-string/commit/fd6769c))
* Refactor to replace mocha with tape ([`be30cfc`](https://github.com/wooorm/mdast-util-to-string/commit/be30cfc))
* Update `mdast` to `remark` ([`7aa31fe`](https://github.com/wooorm/mdast-util-to-string/commit/7aa31fe))
1.0.0 / 2015-08-17

@@ -6,0 +17,0 @@ ==================

7

index.js
/**
* @author Titus Wormer
* @copyright 2015 Titus Wormer. All rights reserved.
* @copyright 2015 Titus Wormer
* @license MIT
* @module mdast:util:to-string
* @fileoverview Utility to get the text value of a node.
* @fileoverview Utility to get the plain text content of a node.
*/

@@ -10,2 +11,4 @@

/* eslint-env node */
/**

@@ -12,0 +15,0 @@ * Get the value of `node`. Checks, `value`,

{
"name": "mdast-util-to-string",
"version": "1.0.0",
"version": "1.0.1",
"description": "Utility to get the plain text content of a node",

@@ -15,36 +15,39 @@ "license": "MIT",

],
"repository": "wooorm/mdast-util-to-string",
"author": "Titus Wormer <tituswormer@gmail.com>",
"repository": {
"type": "git",
"url": "https://github.com/wooorm/mdast-util-to-string.git"
},
"bugs": "https://github.com/wooorm/mdast-util-to-string/issues",
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)",
"files": [
"index.js"
],
"dependencies": {},
"devDependencies": {
"browserify": "^11.0.0",
"browserify": "^13.0.0",
"eslint": "^1.0.0",
"esmangle": "^1.0.0",
"istanbul": "^0.3.0",
"istanbul": "^0.4.0",
"jscs": "^2.0.0",
"jscs-jsdoc": "^1.0.0",
"mdast": "^1.0.0",
"mdast-comment-config": "^1.0.0",
"mdast-github": "^0.3.0",
"mdast-lint": "^0.4.0",
"mdast-slug": "^0.1.1",
"mdast-validate-links": "^0.3.1",
"mocha": "^2.0.0"
"remark": "^3.0.0",
"remark-comment-config": "^2.0.0",
"remark-github": "^3.0.0",
"remark-lint": "^2.0.0",
"remark-slug": "^3.0.0",
"remark-validate-links": "^2.0.0",
"tape": "^4.4.0"
},
"scripts": {
"test-api": "mocha --check-leaks test.js",
"test-coverage": "istanbul cover _mocha -- test.js",
"test-travis": "npm run test-coverage",
"test": "npm run test-api",
"build-md": "remark . --quiet --frail",
"build-bundle": "browserify index.js --no-builtins -s mdastUtilToString > mdast-util-to-string.js",
"build-mangle": "esmangle mdast-util-to-string.js > mdast-util-to-string.min.js",
"build": "npm run build-md && npm run build-bundle && npm run build-mangle",
"lint-api": "eslint .",
"lint-style": "jscs --reporter inline .",
"lint": "npm run lint-api && npm run lint-style",
"make": "npm run lint && npm run test-coverage",
"bundle": "browserify index.js --no-builtins -s mdastUtilToString > mdast-util-to-string.js",
"postbundle": "esmangle mdast-util-to-string.js > mdast-util-to-string.min.js",
"build-md": "mdast . --output --quiet",
"build": "npm run bundle && npm run build-md"
"test-api": "node test.js",
"test-coverage": "istanbul cover test.js",
"test": "npm run build && npm run lint && npm run test-coverage"
}
}

@@ -1,9 +0,9 @@

# mdast-util-to-string [![Build Status](https://img.shields.io/travis/wooorm/mdast-mdast-util-to-string.svg)](https://travis-ci.org/wooorm/mdast-mdast-util-to-string) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/mdast-mdast-util-to-string.svg)](https://codecov.io/github/wooorm/mdast-mdast-util-to-string)
# mdast-util-to-string [![Build Status][travis-badge]][travis] [![Coverage Status][coverage-badge]][coverage]
[**mdast**](https://github.com/wooorm/mdast) utility to get the plain text
content of a node.
[**remark**][remark] utility to get the plain text
content of an [**mdast**][mdast] node.
## Installation
[npm](https://docs.npmjs.com/cli/install):
[npm][npm-install]:

@@ -14,7 +14,5 @@ ```bash

**mdast-util-to-string** is also available for [bower](http://bower.io/#install-packages),
[component](https://github.com/componentjs/component), and
[duo](http://duojs.org/#getting-started), and as an AMD, CommonJS, and globals
module, [uncompressed](mdast-util-to-string.js) and
[compressed](mdast-util-to-string.min.js).
**mdast-util-to-string** is also available for [duo][],
and as an AMD, CommonJS, and globals module,
[uncompressed and compressed][releases].

@@ -28,3 +26,3 @@ ## Usage

var mdast = require('mdast');
var remark = require('remark');
var toString = require('mdast-util-to-string');

@@ -36,3 +34,3 @@

var ast = mdast.parse('Some *emphasis*, **strongness**, and `code`.');
var ast = remark.parse('Some *emphasis*, **strongness**, and `code`.');

@@ -45,9 +43,9 @@ toString(ast);

### toString(node)
### `toString(node)`
Get the text content of a node.
The algorithm checks the value of `node`, then its `alt`, and then
its `title`, in that order. If no value is found, the algorithm checks
the children of `node` and joins them (without spaces or newlines).
The algorithm checks `value` of `node`, then `alt`, and finally `title`.
If no value is found, the algorithm checks the children of `node` and
joins them (without spaces or newlines).

@@ -57,10 +55,36 @@ > This is not a markdown to plain-text library.

Parameters:
**Parameters**:
* `node` (`Node`) — [**mdast** node](https://github.com/wooorm/mdast/blob/master/doc/nodes.md);
* `node` ([`Node`][mdast-node]).
Returns: `string` — text representation of `node`.
**Returns**: `string` — text representation of `node`.
## License
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com)
[MIT][license] © [Titus Wormer][home]
<!-- Definitions -->
[travis-badge]: https://img.shields.io/travis/wooorm/mdast-util-to-string.svg
[travis]: https://travis-ci.org/wooorm/mdast-util-to-string
[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/mdast-util-to-string.svg
[coverage]: https://codecov.io/github/wooorm/mdast-util-to-string
[remark]: https://github.com/wooorm/remark
[mdast]: https://github.com/wooorm/mdast
[mdast-node]: https://github.com/wooorm/mdast#node
[npm-install]: https://docs.npmjs.com/cli/install
[duo]: http://duojs.org/#getting-started
[releases]: https://github.com/wooorm/mdast-util-to-string/releases
[license]: LICENSE
[home]: http://wooorm.com
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