Fix href type, fixed #46

This commit is contained in:
qingwei.li 2016-12-31 22:04:14 +08:00
parent 580767bf78
commit 66d7919fa9
2 changed files with 2 additions and 1 deletions

View File

@ -2,6 +2,7 @@
### Bug fixes
- Fix toggle button style.
- Support `mailto`, `tel`, etc. href type
## 1.4.2

View File

@ -40,7 +40,7 @@ renderer.code = function (code, lang = '') {
return `<pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
}
renderer.link = function (href, title, text) {
if (OPTIONS.router && !/^(?:\w+:)?\/\/([^\s\.]+\.\S{2}|localhost[\:?\d]*)\S*$/.test(href)) {
if (OPTIONS.router && !/:/.test(href)) {
href = `#/${href}`.replace(/\/\//g, '/')
}