From 1566deb8b1f27d80254c1ac3023e0c48e545be75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=9D=A8?= <1711467488@qq.com> Date: Sat, 24 Feb 2018 17:49:00 +0800 Subject: [PATCH] no message Former-commit-id: 2225640189e4909b549a4f37268dccafa93637af Former-commit-id: 9e62bbbe4a133c11e6fd353eaa464aef2a69c332 Former-commit-id: 56300c6fdfe9d5b0ace7b093878c88bfdf401c13 --- src/components/core/Markdown/index.vue | 14 +++++++++++++- src/components/core/Markdown/plugin/baidupan.js | 9 ++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/src/components/core/Markdown/index.vue b/src/components/core/Markdown/index.vue index 73aa8020..7055836e 100644 --- a/src/components/core/Markdown/index.vue +++ b/src/components/core/Markdown/index.vue @@ -3,7 +3,6 @@
正在加载
-
@@ -68,6 +67,7 @@ export default { marked (data) { const renderer = new marked.Renderer() renderer.blockquote = (quote) => { + // 百度网盘 return bandupan(quote) || `
${quote}
` } return marked(data, { @@ -91,5 +91,17 @@ export default { color: $color-primary; } } +$baidupanHeight: 40px; +.baidupan { + height: $baidupanHeight; + overflow: hidden; + margin-bottom: 16px; + .l { + float: left; + } + .r { + float: left; + } +} diff --git a/src/components/core/Markdown/plugin/baidupan.js b/src/components/core/Markdown/plugin/baidupan.js index 4a328a8c..a9774e86 100644 --- a/src/components/core/Markdown/plugin/baidupan.js +++ b/src/components/core/Markdown/plugin/baidupan.js @@ -3,7 +3,14 @@ export default (quote) => { const bdShareUrl = /^https:\/\/pan\.baidu\.com\/s\/[a-z0-9]+$/i const bdShareUrlPwd = /^链接: https:\/\/pan\.baidu\.com\/s\/[a-z0-9]+ 密码: [a-z0-9]{4}$/i if (bdShareUrl.test(_quote)) { - return `
${_quote}
` + return `
+
+ +
+
+ ${_quote} +
+
` } else if (bdShareUrlPwd.test(_quote)) { const url = _quote.match(/https:\/\/pan\.baidu\.com\/s\/[a-z0-9]+/i) const pwd = _quote.match(/[a-z0-9]{4}$/i)