|
@ -18,14 +18,20 @@ __v4.+ changed internals! Plugins need update. See [migration details](https://g |
|
|
|
|
|
|
|
|
__Table of content__ |
|
|
__Table of content__ |
|
|
|
|
|
|
|
|
- [Install](#install) |
|
|
- [markdown-it](#markdown-it) |
|
|
- [Usage examples](#usage-examples) |
|
|
- [Install](#install) |
|
|
- [API](#api) |
|
|
- [Usage examples](#usage-examples) |
|
|
- [Syntax extensions](#syntax-extensions) |
|
|
- [Simple](#simple) |
|
|
- [Benchmark](#benchmark) |
|
|
- [Init with presets and options](#init-with-presets-and-options) |
|
|
- [Authors](#authors) |
|
|
- [Plugins load](#plugins-load) |
|
|
- [References / Thanks](#references--thanks) |
|
|
- [Syntax highlighting](#syntax-highlighting) |
|
|
- [License](#license) |
|
|
- [API](#api) |
|
|
|
|
|
- [Syntax extensions](#syntax-extensions) |
|
|
|
|
|
- [Manage rules](#manage-rules) |
|
|
|
|
|
- [Benchmark](#benchmark) |
|
|
|
|
|
- [Authors](#authors) |
|
|
|
|
|
- [References / Thanks](#references--thanks) |
|
|
|
|
|
- [License](#license) |
|
|
|
|
|
|
|
|
## Install |
|
|
## Install |
|
|
|
|
|
|
|
@ -142,7 +148,7 @@ var md = require('markdown-it')({ |
|
|
highlight: function (str, lang) { |
|
|
highlight: function (str, lang) { |
|
|
if (lang && hljs.getLanguage(lang)) { |
|
|
if (lang && hljs.getLanguage(lang)) { |
|
|
try { |
|
|
try { |
|
|
return hljs.highlight(lang, str).value; |
|
|
return hljs.highlight(str, { language: lang }).value; |
|
|
} catch (__) {} |
|
|
} catch (__) {} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|