-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: run Node.js markdown formatter on markdown output (#98)
To increase the probability of producing markdown that will pass the Node.js linter, use the Node.js linter to format markdown output.
- Loading branch information
Showing
4 changed files
with
12,008 additions
and
592 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { remark } from 'remark' | ||
import remarkParse from 'remark-parse' | ||
import remarkStringify from 'remark-stringify' | ||
import presetLintNode from 'remark-preset-lint-node' | ||
|
||
const formatter = remark() | ||
.use(remarkParse) | ||
.use(presetLintNode) | ||
.use(remarkStringify) | ||
|
||
const format = async (markdown) => { | ||
const result = await formatter.process(markdown) | ||
return result.toString() | ||
} | ||
|
||
export default format |
Oops, something went wrong.