mirror of
https://github.com/gohugoio/hugo.git
synced 2025-02-18 11:01:32 +00:00
parent
05c07c561a
commit
483fc8fa3d
1 changed files with 16 additions and 10 deletions
|
@ -40,21 +40,23 @@ var SummaryDivider = []byte("<!--more-->")
|
||||||
|
|
||||||
// Blackfriday holds configuration values for Blackfriday rendering.
|
// Blackfriday holds configuration values for Blackfriday rendering.
|
||||||
type Blackfriday struct {
|
type Blackfriday struct {
|
||||||
AngledQuotes bool
|
AngledQuotes bool
|
||||||
Fractions bool
|
Fractions bool
|
||||||
LatexDashes bool
|
HrefTargetBlank bool
|
||||||
PlainIDAnchors bool
|
LatexDashes bool
|
||||||
Extensions []string
|
PlainIDAnchors bool
|
||||||
ExtensionsMask []string
|
Extensions []string
|
||||||
|
ExtensionsMask []string
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewBlackfriday creates a new Blackfriday with some sane defaults.
|
// NewBlackfriday creates a new Blackfriday with some sane defaults.
|
||||||
func NewBlackfriday() *Blackfriday {
|
func NewBlackfriday() *Blackfriday {
|
||||||
return &Blackfriday{
|
return &Blackfriday{
|
||||||
AngledQuotes: false,
|
AngledQuotes: false,
|
||||||
Fractions: true,
|
Fractions: true,
|
||||||
LatexDashes: true,
|
HrefTargetBlank: false,
|
||||||
PlainIDAnchors: false,
|
LatexDashes: true,
|
||||||
|
PlainIDAnchors: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -157,6 +159,10 @@ func GetHTMLRenderer(defaultFlags int, ctx *RenderingContext) blackfriday.Render
|
||||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
|
htmlFlags |= blackfriday.HTML_SMARTYPANTS_FRACTIONS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ctx.getConfig().HrefTargetBlank {
|
||||||
|
htmlFlags |= blackfriday.HTML_HREF_TARGET_BLANK
|
||||||
|
}
|
||||||
|
|
||||||
if ctx.getConfig().LatexDashes {
|
if ctx.getConfig().LatexDashes {
|
||||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
htmlFlags |= blackfriday.HTML_SMARTYPANTS_LATEX_DASHES
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue