diff --git a/src/css/var.scss b/src/css/var.scss index 86265ee..152ac9d 100644 --- a/src/css/var.scss +++ b/src/css/var.scss @@ -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; diff --git a/src/js/marked/index.js b/src/js/marked/index.js index eb72476..8b7a24f 100644 --- a/src/js/marked/index.js +++ b/src/js/marked/index.js @@ -863,19 +863,11 @@ Renderer.prototype.html = function(html) { Renderer.prototype.heading = function(text, level, raw) { raw = text.replace(/<[^>]+>|<\/[^>]+>/g, '') - return ( - '' + - text + - '\n' - ) + return ` + + ${text} + + ` } Renderer.prototype.hr = function() { diff --git a/src/js/marked/theme.scss b/src/js/marked/theme.scss index 4ac2681..51ccea8 100644 --- a/src/js/marked/theme.scss +++ b/src/js/marked/theme.scss @@ -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; diff --git a/src/js/prism/highlight.scss b/src/js/prism/highlight.scss index ef8f98f..f77b9bc 100644 --- a/src/js/prism/highlight.scss +++ b/src/js/prism/highlight.scss @@ -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;} \ No newline at end of file +.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";} \ No newline at end of file diff --git a/src/js/router/index.js b/src/js/router/index.js index ece7b1c..687f91b 100644 --- a/src/js/router/index.js +++ b/src/js/router/index.js @@ -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 }