feat(compiler): support for setting target attribute for link, fixed #230

This commit is contained in:
qingwei.li 2017-08-10 08:45:49 +08:00
commit 7f270f93c6
4 changed files with 28 additions and 0 deletions

View file

@ -105,6 +105,13 @@ export class Compiler {
title = title && title.replace(/:ignore/g, '').trim()
}
let target = title && title.match(/:target=\w+/)
if (target) {
target = target[0]
title = title.replace(target, '')
blank = ' ' + target.slice(1)
}
if (title) {
title = ` title="${title}"`
}