Format JavaScript in your markdown code.
npm install markdown-it-prettier   
``bash`
yarn add prettier markdown-it-prettier
`js
const md = require('markdown-it')()
const prettier = require('markdown-it-prettier')
const options = { singleQuote: true }
md.use(prettier, options)
`
###
In:
``markdown`js
hello ( "world"
)
class Foo{
log() {return "42"}
}
```
Out:
``htmlhello('world');
class Foo {
log() {
return '42';
}
}
```
It could format all kinds of code that Prettier could format.
1. Fork it!
2. Create your feature branch: git checkout -b my-new-featuregit commit -am 'Add some feature'
3. Commit your changes: git push origin my-new-feature`
4. Push to the branch:
5. Submit a pull request :D
markdown-it-prettier © egoist, Released under the MIT License.
Authored and maintained by egoist with help from contributors (list).
> egoistian.com · GitHub @egoist · Twitter @_egoistlily