mirror of
https://github.com/docsifyjs/docsify.git
synced 2025-12-08 19:55:52 +00:00
fix(compiler): link
This commit is contained in:
parent
c108645e34
commit
c7e09c34a7
@ -67,7 +67,13 @@ 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) {
|
||||
return `<a href="${toURL(href)}" title="${title || text}">${text}</a>`
|
||||
let blank = ''
|
||||
if (!/:|(\/{2})/.test(href)) {
|
||||
href = toURL(href)
|
||||
} else {
|
||||
blank = ' target="_blank"'
|
||||
}
|
||||
return `<a href="${href}" title="${title || text}"${blank}>${text}</a>`
|
||||
}
|
||||
renderer.paragraph = function (text) {
|
||||
if (/^!>/.test(text)) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user