Skip to content

Commit

Permalink
Fix href type, fixed #46
Browse files Browse the repository at this point in the history
  • Loading branch information
QingWei-Li committed Dec 31, 2016
1 parent 580767b commit 66d7919
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

### Bug fixes
- Fix toggle button style.
- Support `mailto`, `tel`, etc. href type


## 1.4.2
Expand Down
2 changes: 1 addition & 1 deletion src/render.js
Original file line number Diff line number Diff line change
Expand Up @@ -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, '/')
}

Expand Down

0 comments on commit 66d7919

Please sign in to comment.