remark-retext
Advanced tools
Comparing version 3.0.1 to 3.1.0
18
index.js
@@ -12,12 +12,12 @@ 'use strict'; | ||
* plug-ins run on that tree (mutate-mode). */ | ||
function remark2retext(destination) { | ||
function remark2retext(destination, options) { | ||
var fn = destination && destination.run ? bridge : mutate; | ||
return fn(destination); | ||
return fn(destination, options); | ||
} | ||
/* Mutate-mode. Further transformers run on the NLCST tree. */ | ||
function mutate(parser) { | ||
function mutate(parser, options) { | ||
return transformer; | ||
function transformer(node, file) { | ||
return mdast2nlcst(node, file, parser); | ||
return mdast2nlcst(node, file, parser, options); | ||
} | ||
@@ -28,12 +28,12 @@ } | ||
* tree. */ | ||
function bridge(destination) { | ||
function bridge(destination, options) { | ||
return transformer; | ||
function transformer(node, file, next) { | ||
var Parser = destination.freeze().Parser; | ||
var tree = mdast2nlcst(node, file, Parser); | ||
destination.run(tree, file, function (err) { | ||
var tree = mdast2nlcst(node, file, Parser, options); | ||
destination.run(tree, file, done); | ||
function done(err) { | ||
next(err); | ||
}); | ||
} | ||
} | ||
} |
{ | ||
"name": "remark-retext", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "retext support for remark", | ||
@@ -22,3 +22,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"mdast-util-to-nlcst": "^3.0.0" | ||
"mdast-util-to-nlcst": "^3.2.0" | ||
}, | ||
@@ -29,6 +29,6 @@ "devDependencies": { | ||
"nyc": "^11.0.0", | ||
"remark-cli": "^3.0.0", | ||
"remark-parse": "^3.0.0", | ||
"remark-cli": "^4.0.0", | ||
"remark-parse": "^4.0.0", | ||
"remark-preset-wooorm": "^3.0.0", | ||
"remark-stringify": "^3.0.0", | ||
"remark-stringify": "^4.0.0", | ||
"retext-english": "^3.0.0", | ||
@@ -35,0 +35,0 @@ "retext-stringify": "^2.0.0", |
@@ -53,3 +53,3 @@ # remark-retext [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
### `origin.use(remark2retext, destination)` | ||
### `origin.use(remark2retext, destination[, options])` | ||
@@ -72,2 +72,6 @@ Either bridge or mutate from [**remark**][remark] ([MDAST][]) to | ||
###### `options` | ||
Passed to [`mdast-util-to-nlcst`][to-nlcst]. | ||
## Related | ||
@@ -81,2 +85,4 @@ | ||
— Transform HTML to markdown | ||
* [`mdast-util-to-nlcst`][to-nlcst] | ||
— Underlying algorithm | ||
@@ -120,1 +126,3 @@ ## License | ||
[dutch]: https://github.com/wooorm/parse-dutch | ||
[to-nlcst]: https://github.com/syntax-tree/mdast-util-to-nlcst |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6939
32
125
Updatedmdast-util-to-nlcst@^3.2.0