Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,23 @@ console.log(html);
// <em>this</em> is <strong>easy</strong> to <code>use</code>.
```

### Options
Snarkdown also accepts an optional `options` object.

#### `options.highlight`
Highlight code blocks when parsed. Accepts a function with the signature `hightlight(code, language)`. Return a highlighted string using the library or your choice.
```javascript
import snarkdown from 'snarkdown'
import prism from 'prismjs'

let md = '```javascript \n let md = "a javascript code block";```'
let html = snarkdown(md, {
highlight: (code, language) => {
return prism.highlight(code, prism.languages[language])
}
});
```


## License

Expand Down
Loading