Open markdown image links in new window (#17287)

This commit is contained in:
wxiaoguang 2021-10-11 20:12:06 +08:00 committed by GitHub
parent 758c8c8446
commit d8e06a90f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View file

@ -114,6 +114,7 @@ func (g *ASTTransformer) Transform(node *ast.Document, reader text.Reader, pc pa
wrap := ast.NewLink()
wrap.Destination = link
wrap.Title = v.Title
wrap.SetAttributeString("target", []byte("_blank"))
// Duplicate the current image node
image := ast.NewImage(ast.NewLink())