Skip to content

Commit

Permalink
Deprecate Blackfriday and fix a potential deadlock in config
Browse files Browse the repository at this point in the history
Note that the deadlock has not been seen earlier, in tests on in real Hugo sites.

Fixes #8792
Fixes #8791
  • Loading branch information
bep committed Jul 26, 2021
1 parent e09d788 commit c725222
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/defaultConfigProvider.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (c *defaultConfigProvider) Get(k string) interface{} {
c.mu.RLock()
key, m := c.getNestedKeyAndMap(strings.ToLower(k), false)
if m == nil {
c.mu.RUnlock()
return nil
}
v := m[key]
Expand Down
6 changes: 6 additions & 0 deletions hugolib/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,18 @@ func LoadConfig(d ConfigSourceDescriptor, doWithConfig ...func(cfg config.Provid
}
}

// Config deprecations.
// We made this a Glob pattern in Hugo 0.75, we don't need both.
if l.cfg.GetBool("ignoreVendor") {
helpers.Deprecated("--ignoreVendor", "--ignoreVendorPaths **", true)
l.cfg.Set("ignoreVendorPaths", "**")
}

if l.cfg.GetString("markup.defaultMarkdownHandler") == "blackfriday" {
helpers.Deprecated("markup.defaultMarkdownHandler=blackfriday", "See https://gohugo.io//content-management/formats/#list-of-content-formats", false)

}

// Some settings are used before we're done collecting all settings,
// so apply OS environment both before and after.
if err := l.applyOsEnvOverrides(d.Environ); err != nil {
Expand Down

0 comments on commit c725222

Please sign in to comment.