feat(render): add auto header

This commit is contained in:
qingwei.li 2017-02-18 21:59:19 +08:00 • committed by cinwell.li
commit b7768b1b3c
6 changed files with 50 additions and 26 deletions

View file

@ -67,10 +67,7 @@ renderer.code = function (code, lang = '') {
return `<pre v-pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
}
renderer.link = function (href, title, text) {
if (!/:|(\/{2})/.test(href)) {
href = toURL(href)
}
return `<a href="${href}" title="${title || ''}">${text}</a>`
return `<a href="${toURL(href)}" title="${title || text}">${text}</a>`
}
renderer.paragraph = function (text) {
if (/^!&gt;/.test(text)) {