mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-11 20:03:58 +02:00
@@ -63,6 +63,7 @@ func NewContentSpec(cfg config.Provider) *ContentSpec {
|
||||
// Blackfriday holds configuration values for Blackfriday rendering.
|
||||
type Blackfriday struct {
|
||||
Smartypants bool
|
||||
SmartypantsQuotesNBSP bool
|
||||
AngledQuotes bool
|
||||
Fractions bool
|
||||
HrefTargetBlank bool
|
||||
@@ -81,6 +82,7 @@ func (c ContentSpec) NewBlackfriday() *Blackfriday {
|
||||
defaultParam := map[string]interface{}{
|
||||
"smartypants": true,
|
||||
"angledQuotes": false,
|
||||
"smartypantsQuotesNBSP": false,
|
||||
"fractions": true,
|
||||
"hrefTargetBlank": false,
|
||||
"smartDashes": true,
|
||||
@@ -229,6 +231,10 @@ func (c ContentSpec) getHTMLRenderer(defaultFlags int, ctx *RenderingContext) bl
|
||||
htmlFlags |= blackfriday.HTML_USE_SMARTYPANTS
|
||||
}
|
||||
|
||||
if ctx.Config.SmartypantsQuotesNBSP {
|
||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_QUOTES_NBSP
|
||||
}
|
||||
|
||||
if ctx.Config.AngledQuotes {
|
||||
htmlFlags |= blackfriday.HTML_SMARTYPANTS_ANGLED_QUOTES
|
||||
}
|
||||
|
Reference in New Issue
Block a user