优化markdown插件;优化代码高亮插件;优化路由事件劫持;
parent
9f9456618e
commit
37500b2917
|
@ -4,7 +4,7 @@ $cpp: #9b59b6 #ac61ce #8e44ad;
|
|||
$cb: #2d8dd6 #52a3de #2776b1;
|
||||
$cr: #e34235 #e96458 #be382d;
|
||||
$co: #f39c12 #ffb618 #e67e22;
|
||||
$cp: #e7e8eb #ecf0f1 #bdc3c7;
|
||||
$cp: #e7e8eb #f3f5fb #bdc3c7;
|
||||
$cgr: #8a9b9c #98acae #748182;
|
||||
$cd: #526273 #62778d #34495e;
|
||||
|
||||
|
|
|
@ -863,19 +863,11 @@ Renderer.prototype.html = function(html) {
|
|||
|
||||
Renderer.prototype.heading = function(text, level, raw) {
|
||||
raw = text.replace(/<[^>]+>|<\/[^>]+>/g, '')
|
||||
return (
|
||||
'<h' +
|
||||
level +
|
||||
' class="md-head" id="' +
|
||||
raw +
|
||||
'"><a href="#' +
|
||||
raw +
|
||||
'">' +
|
||||
text +
|
||||
'</a></h' +
|
||||
level +
|
||||
'>\n'
|
||||
)
|
||||
return `
|
||||
<h${level} class="md-head" id="${raw}">
|
||||
<span><a href="#${raw}" class="do-icon-pin"></a>${text}</span>
|
||||
</h${level}>
|
||||
`
|
||||
}
|
||||
|
||||
Renderer.prototype.hr = function() {
|
||||
|
|
|
@ -11,10 +11,11 @@
|
|||
|
||||
.md-head {position:relative;margin:15px 0;padding-left:30px;font-weight:normal;font-size:17px;}
|
||||
h1.md-head {padding-left:0;}
|
||||
.md-head a {position:relative;display:inline-block;padding:0 8px;background:#fff;color:#454545}
|
||||
.md-head a:hover {text-decoration:none;}
|
||||
h1.md-head a {padding-left:0;color:#000;}
|
||||
h2.md-head a {color:#000;}
|
||||
.md-head span {position:relative;display:inline-block;padding:0 8px;background:#fff;color:#454545}
|
||||
.md-head a {padding:0 3px;font-weight:bold;text-decoration:none;}
|
||||
.md-head a:hover {transform:scale(1.2)}
|
||||
h1.md-head span {padding-left:0;color:#000;}
|
||||
h2.md-head span {color:#000;}
|
||||
|
||||
h1.md-head {margin:0 0 30px;font-size:25px;}
|
||||
h2.md-head {margin:20px 0;font-size:23px;}
|
||||
|
@ -26,10 +27,10 @@
|
|||
h5:before,
|
||||
h6:before {display:block;position:absolute;left:0;top:50%;width:100%;content:" ";border-bottom:1px solid #ddd;}
|
||||
|
||||
a {text-decoration:none;}
|
||||
a:hover {text-decoration:underline;}
|
||||
a {text-decoration:underline;}
|
||||
a:hover {color:nth($co, 1)}
|
||||
p {margin:15px 0;}
|
||||
blockquote.md-quote {margin:10px 0;padding:5px 10px;border-left:5px solid #6bb294;background:#f7f7f7}
|
||||
blockquote.md-quote {margin:10px 0;padding:5px 10px;border-left:5px solid nth($cp, 3);background:nth($cp, 2)}
|
||||
blockquote.md-quote p {margin:0;}
|
||||
/* 提醒文本 */
|
||||
.md-warn,.md-mark {display:inline-block;position:relative;min-height:40px;margin:5px 0;padding:5px 8px 5px 50px;border:1px solid nth($co, 1);border-radius:5px;background:#fffbed;color:nth($co, 3);word-break: break-all;
|
||||
|
|
|
@ -46,4 +46,4 @@
|
|||
}
|
||||
}
|
||||
/*行内代码*/
|
||||
.do-ui-inlinecode {display:inline-block;margin:0 2px;padding:0 5px;line-height: 1.5;color:#d14;background: nth($cp, 2);border-radius:3px;}
|
||||
.do-ui-inlinecode {display:inline-block;margin:0 2px;padding:0 5px;line-height: 1.5;color:#d14;background: nth($cp, 2);border-radius:3px;font-family: "Courier New";}
|
|
@ -107,7 +107,11 @@ class Router {
|
|||
let href =
|
||||
target.getAttribute('href') || target.getAttribute('xlink:href')
|
||||
|
||||
if (!href) {
|
||||
if (
|
||||
!href ||
|
||||
/^(http[s]?:|ftp:)?\/\//.test(href) ||
|
||||
/^javascript:/.test(href)
|
||||
) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue