no message
Former-commit-id: 2225640189e4909b549a4f37268dccafa93637af Former-commit-id: 9e62bbbe4a133c11e6fd353eaa464aef2a69c332 Former-commit-id: 56300c6fdfe9d5b0ace7b093878c88bfdf401c13
This commit is contained in:
@@ -3,7 +3,6 @@
|
|||||||
<div class="spin-group" v-if="!markedHTML">
|
<div class="spin-group" v-if="!markedHTML">
|
||||||
<div>正在加载</div>
|
<div>正在加载</div>
|
||||||
</div>
|
</div>
|
||||||
<img src="/static/image/baidu-pan-logo.png">
|
|
||||||
<div class="markdown-body" v-html="markedHTML"></div>
|
<div class="markdown-body" v-html="markedHTML"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -68,6 +67,7 @@ export default {
|
|||||||
marked (data) {
|
marked (data) {
|
||||||
const renderer = new marked.Renderer()
|
const renderer = new marked.Renderer()
|
||||||
renderer.blockquote = (quote) => {
|
renderer.blockquote = (quote) => {
|
||||||
|
// 百度网盘
|
||||||
return bandupan(quote) || `<blockquote>${quote}</blockquote>`
|
return bandupan(quote) || `<blockquote>${quote}</blockquote>`
|
||||||
}
|
}
|
||||||
return marked(data, {
|
return marked(data, {
|
||||||
@@ -91,5 +91,17 @@ export default {
|
|||||||
color: $color-primary;
|
color: $color-primary;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$baidupanHeight: 40px;
|
||||||
|
.baidupan {
|
||||||
|
height: $baidupanHeight;
|
||||||
|
overflow: hidden;
|
||||||
|
margin-bottom: 16px;
|
||||||
|
.l {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
.r {
|
||||||
|
float: left;
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,14 @@ export default (quote) => {
|
|||||||
const bdShareUrl = /^https:\/\/pan\.baidu\.com\/s\/[a-z0-9]+$/i
|
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
|
const bdShareUrlPwd = /^链接: https:\/\/pan\.baidu\.com\/s\/[a-z0-9]+ 密码: [a-z0-9]{4}$/i
|
||||||
if (bdShareUrl.test(_quote)) {
|
if (bdShareUrl.test(_quote)) {
|
||||||
return `<div style="color: red;">${_quote}</div>`
|
return `<div class="baidupan">
|
||||||
|
<div class="l">
|
||||||
|
<img src="/static/image/baidu-pan-logo.png">
|
||||||
|
</div>
|
||||||
|
<div class="r">
|
||||||
|
<a href="${_quote}">${_quote}</a>
|
||||||
|
</div>
|
||||||
|
</div>`
|
||||||
} else if (bdShareUrlPwd.test(_quote)) {
|
} else if (bdShareUrlPwd.test(_quote)) {
|
||||||
const url = _quote.match(/https:\/\/pan\.baidu\.com\/s\/[a-z0-9]+/i)
|
const url = _quote.match(/https:\/\/pan\.baidu\.com\/s\/[a-z0-9]+/i)
|
||||||
const pwd = _quote.match(/[a-z0-9]{4}$/i)
|
const pwd = _quote.match(/[a-z0-9]{4}$/i)
|
||||||
|
|||||||
Reference in New Issue
Block a user