fix: update match regex (#669)

This commit is contained in:
程康 2018-10-31 23:09:34 +00:00 committed by cinwell.li
parent b52607dec9
commit 2edf47ec73

View File

@ -176,9 +176,10 @@ export function renderMixin(proto) {
dom.toggleClass(el, 'add', 'show') dom.toggleClass(el, 'add', 'show')
let html = this.coverIsHTML ? text : this.compiler.cover(text) let html = this.coverIsHTML ? text : this.compiler.cover(text)
const m = html const m = html
.trim() .trim()
.match('<p><img.*?data-origin="(.*?)"[^a]+alt="(.*?)">([^<]*?)</p>$') .match('<img.*?data-origin="(.*?)"[^a]+alt="(.*?)">([^<]*?)$')
if (m) { if (m) {
if (m[2] === 'color') { if (m[2] === 'color') {