mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-12 20:13:59 +02:00
@@ -42,6 +42,7 @@ var SummaryDivider = []byte("<!--more-->")
|
||||
type Blackfriday struct {
|
||||
AngledQuotes bool
|
||||
Fractions bool
|
||||
HrefTargetBlank bool
|
||||
LatexDashes bool
|
||||
PlainIDAnchors bool
|
||||
Extensions []string
|
||||
@@ -53,6 +54,7 @@ func NewBlackfriday() *Blackfriday {
|
||||
return &Blackfriday{
|
||||
AngledQuotes: false,
|
||||
Fractions: true,
|
||||
HrefTargetBlank: false,
|
||||
LatexDashes: true,
|
||||
PlainIDAnchors: false,
|
||||
}
|
||||
@@ -157,6 +159,10 @@ func GetHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Render
|
||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
|
||||
}
|
||||
|
||||
if ctx.getConfig().HrefTargetBlank {
|
||||
htmlFlags |= blackfriday.HTML_HREF_TARGET_BLANK
|
||||
}
|
||||
|
||||
if ctx.getConfig().LatexDashes {
|
||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
||||
}
|
||||
|
Reference in New Issue
Block a user