merge marked renderer function instead of overiding it. (#74)

This commit is contained in:
Liu Yuyang 2017-02-13 22:44:43 +08:00 committed by cinwell.li
commit 434e8d1a36
4 changed files with 6 additions and 5 deletions

View file

@ -58,9 +58,11 @@ export function init () {
}
if (typeof $docsify.markdown === 'function') {
markdown.setOptions({ renderer })
markdown = $docsify.markdown.call(this, markdown)
markdown = $docsify.markdown.call(this, markdown, renderer)
} else {
if ($docsify.markdown.renderer) {
$docsify.markdown.renderer = merge(renderer, $docsify.markdown.renderer)
}
markdown.setOptions(merge({ renderer }, $docsify.markdown))
}