-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
1,561 additions
and
1,361 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 'highlight.js/styles/atom-one-light.css' | ||
|
||
import hljs from 'highlight.js' | ||
|
||
const highlightPlugin = md => { | ||
md.renderer.rules.fence = (tokens, idx) => { | ||
const token = tokens[idx] | ||
const code = token.content.trim() | ||
const lang = token.info ? [token.info] : undefined | ||
return `<pre><code class="hljs">${ | ||
hljs.highlightAuto(code, lang).value | ||
}</code></pre>` | ||
} | ||
} | ||
|
||
export default highlightPlugin |
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
Oops, something went wrong.