Merge pull request #1170 from vsemozhetbyt/patch-2

Fix nits in code example in USING_ADVANCED.md
This commit is contained in:
Steven 2018-03-27 19:31:44 -04:00 committed by GitHub
commit 3400fd83f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -19,9 +19,9 @@ var myMarked = require('marked');
// Set options
// `highlight` example uses `highlight.js`
myMarked.setOptions({
renderer: new marked.Renderer(),
renderer: new myMarked.Renderer(),
highlight: function(code) {
return require('highlight.js').highlightAuto(code).value;
return require('highlight.js').highlightAuto(code).value;
},
pedantic: false,
gfm: true,
@ -68,4 +68,4 @@ myMarked.setOptions({
console.log(myMarked(markdownString));
```
In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete.
In both examples, `code` is a `string` representing the section of code to pass to the highlighter. In this example, `lang` is a `string` informing the highlighter what programming lnaguage to use for the `code` and `callback` is the `function` the asynchronous highlighter will call once complete.