Fix href type, fixed #46
This commit is contained in:
parent
580767bf78
commit
66d7919fa9
2 changed files with 2 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
### Bug fixes
|
### Bug fixes
|
||||||
- Fix toggle button style.
|
- Fix toggle button style.
|
||||||
|
- Support `mailto`, `tel`, etc. href type
|
||||||
|
|
||||||
|
|
||||||
## 1.4.2
|
## 1.4.2
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,7 @@ renderer.code = function (code, lang = '') {
|
||||||
return `<pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
|
return `<pre data-lang="${lang}"><code class="lang-${lang}">${hl}</code></pre>`
|
||||||
}
|
}
|
||||||
renderer.link = function (href, title, text) {
|
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, '/')
|
href = `#/${href}`.replace(/\/\//g, '/')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue