@textlint/textlint-plugin-markdown
Advanced tools
Comparing version 4.0.10 to 4.1.0-alpha.bbfc8f6d
@@ -17,9 +17,17 @@ /* eslint-disable no-unused-vars */ | ||
var MarkdownProcessor = exports.MarkdownProcessor = function () { | ||
function MarkdownProcessor(config) { | ||
function MarkdownProcessor() { | ||
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | ||
_classCallCheck(this, MarkdownProcessor); | ||
this.config = config; | ||
this.extensions = config.extensions ? config.extensions : []; | ||
} | ||
_createClass(MarkdownProcessor, [{ | ||
key: "availableExtensions", | ||
value: function availableExtensions() { | ||
return [".md", ".markdown", ".mdown", ".mkdn", ".mkd", ".mdwn", ".mkdown", ".ron"].concat(this.extensions); | ||
} | ||
}, { | ||
key: "processor", | ||
@@ -39,7 +47,2 @@ value: function processor(ext) { | ||
} | ||
}], [{ | ||
key: "availableExtensions", | ||
value: function availableExtensions() { | ||
return [".md", ".markdown", ".mdown", ".mkdn", ".mkd", ".mdwn", ".mkdown", ".ron"]; | ||
} | ||
}]); | ||
@@ -46,0 +49,0 @@ |
{ | ||
"name": "@textlint/textlint-plugin-markdown", | ||
"version": "4.0.10", | ||
"version": "4.1.0-alpha.bbfc8f6d", | ||
"description": "Markdown support for textlint.", | ||
@@ -36,3 +36,3 @@ "keywords": [ | ||
"dependencies": { | ||
"@textlint/markdown-to-ast": "^6.0.8" | ||
"@textlint/markdown-to-ast": "^6.1.0-alpha.bbfc8f6d" | ||
}, | ||
@@ -46,6 +46,6 @@ "devDependencies": { | ||
"cross-env": "^4.0.0", | ||
"mocha": "^4.0.1", | ||
"mocha": "^5.1.1", | ||
"power-assert": "^1.4.1", | ||
"rimraf": "^2.6.2", | ||
"textlint": "^10.2.1", | ||
"textlint": "^10.3.0-alpha.bbfc8f6d", | ||
"textlint-rule-no-todo": "^2.0.0" | ||
@@ -52,0 +52,0 @@ }, |
@@ -16,12 +16,30 @@ # @textlint/textlint-plugin-markdown | ||
Manually add Markdown plugin to do following: | ||
Following config is set by default. | ||
``` | ||
{ | ||
"plugins": [ | ||
"markdown" | ||
] | ||
"plugins": { | ||
"@textlint/markdown": true | ||
} | ||
} | ||
``` | ||
## Options | ||
- `extensions`: `string[]` | ||
- Additional file extensions for markdown | ||
For example, if you want to treat `.hown` as markdown, put following config to `.textlintrc` | ||
```json5 | ||
{ | ||
"plugins": { | ||
"@textlint/markdown": { | ||
"extensions": [".hown"] | ||
} | ||
} | ||
} | ||
``` | ||
## Tests | ||
@@ -28,0 +46,0 @@ |
@@ -5,9 +5,11 @@ /* eslint-disable no-unused-vars */ | ||
import { parse } from "@textlint/markdown-to-ast"; | ||
export class MarkdownProcessor { | ||
constructor(config) { | ||
constructor(config = {}) { | ||
this.config = config; | ||
this.extensions = config.extensions ? config.extensions : []; | ||
} | ||
static availableExtensions() { | ||
return [".md", ".markdown", ".mdown", ".mkdn", ".mkd", ".mdwn", ".mkdown", ".ron"]; | ||
availableExtensions() { | ||
return [".md", ".markdown", ".mdown", ".mkdn", ".mkd", ".mdwn", ".mkdown", ".ron"].concat(this.extensions); | ||
} | ||
@@ -14,0 +16,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14637
79
59
1