Skip to content

Commit

Permalink
[update]target属性を付与するように変更
Browse files Browse the repository at this point in the history
  • Loading branch information
920oj committed Jan 20, 2021
1 parent 0601fa4 commit 0f7f484
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,12 @@ func main() {
}

// MarkdownをHTML化
htmlFlags := blackfriday.HrefTargetBlank // aタグにtarget="_blank"を付与
htmlFlags |= blackfriday.NoreferrerLinks // aタグにrel="noreferrer"を付与
htmlFlags |= blackfriday.NoopenerLinks // aタグにrel="noopener"を付与
renderer := blackfriday.NewHTMLRenderer(blackfriday.HTMLRendererParameters{Flags: htmlFlags, Title: "", CSS: ""})
exts := blackfriday.Autolink // リンクを自動でaタグにする
htmlData := blackfriday.Run(md, blackfriday.WithExtensions(exts))
htmlData := blackfriday.Run(md, blackfriday.WithExtensions(exts), blackfriday.WithRenderer(renderer))

// 設定ファイルとHTML化したMarkdownを一つの構造体に移す
data := new(InputData)
Expand Down

0 comments on commit 0f7f484

Please sign in to comment.