remark-lint-match-punctuation
Advanced tools
Comparing version 0.1.1 to 0.2.0
@@ -5,6 +5,2 @@ const rule = require('unified-lint-rule'); | ||
const pairs = [ | ||
'()', | ||
'<>', | ||
'{}', | ||
'[]', | ||
'“”', | ||
@@ -45,4 +41,4 @@ '『』', | ||
function processor(tree, file) { | ||
const processors = pairs.map(pair => new Validator(pair, file)); | ||
function processor(tree, file, config = pairs) { | ||
const processors = config.map(pair => new Validator(pair, file)); | ||
toList(tree, (list) => { | ||
@@ -49,0 +45,0 @@ list.forEach((node) => { |
{ | ||
"name": "remark-lint-match-punctuation", | ||
"version": "0.1.1", | ||
"version": "0.2.0", | ||
"author": "LaySent <laysent@gmail.com>", | ||
@@ -5,0 +5,0 @@ "bugs": { |
@@ -10,4 +10,20 @@ # remark-lint-match-punctuation | ||
`()`, `<>`, `{}`, `[]`, `“”`, `『』`, `()`, `《》`, `「」`, `【】`, `‘’` | ||
`“”`, `『』`, `()`, `《》`, `「」`, `【】`, `‘’` | ||
## Option | ||
If you would like to override the default punctuation check list above, you can | ||
pass a list of pairs as configuration. It should be a list of string, with first | ||
character representing the left punctuation and second character representing | ||
it's right pair. | ||
For example: | ||
```javascript | ||
[require('remark-lint-match-punctuation'), ['()']] | ||
``` | ||
This will override the default behavior and only warn when `()` has any | ||
mismatch. | ||
## Example | ||
@@ -81,3 +97,3 @@ | ||
.use(require('remark-lint')) | ||
+ .use(require('remark-lint-match-punctuation')) | ||
+ .use(require('remark-lint-match-punctuation')[, options]) | ||
.process('_Emphasis_ and **importance**', function (err, file) { | ||
@@ -84,0 +100,0 @@ console.error(report(err || file)); |
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
5469
105
49