mirror of
https://github.com/gohugoio/hugo.git
synced 2025-04-27 06:00:25 +03:00
Remove Blackfriday markdown engine
It has been deprecated for a long time, its v1 version is not maintained anymore, and there are many known issues. Goldmark should be a mature replacement by now. Closes #9934
This commit is contained in:
parent
3b478f50b7
commit
0f8dc47037
22 changed files with 71 additions and 1675 deletions
|
@ -18,7 +18,6 @@ import (
|
|||
"github.com/gohugoio/hugo/config"
|
||||
"github.com/gohugoio/hugo/docshelper"
|
||||
"github.com/gohugoio/hugo/markup/asciidocext/asciidocext_config"
|
||||
"github.com/gohugoio/hugo/markup/blackfriday/blackfriday_config"
|
||||
"github.com/gohugoio/hugo/markup/goldmark/goldmark_config"
|
||||
"github.com/gohugoio/hugo/markup/highlight"
|
||||
"github.com/gohugoio/hugo/markup/tableofcontents"
|
||||
|
@ -37,8 +36,6 @@ type Config struct {
|
|||
|
||||
// Content renderers
|
||||
Goldmark goldmark_config.Config
|
||||
BlackFriday blackfriday_config.Config
|
||||
|
||||
AsciidocExt asciidocext_config.Config
|
||||
}
|
||||
|
||||
|
@ -56,10 +53,6 @@ func Decode(cfg config.Provider) (conf Config, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
if err = applyLegacyConfig(cfg, &conf); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
if err = highlight.ApplyLegacyConfig(cfg, &conf.Highlight); err != nil {
|
||||
return
|
||||
}
|
||||
|
@ -83,26 +76,6 @@ func normalizeConfig(m map[string]any) {
|
|||
}
|
||||
}
|
||||
|
||||
func applyLegacyConfig(cfg config.Provider, conf *Config) error {
|
||||
if bm := cfg.GetStringMap("blackfriday"); bm != nil {
|
||||
// Legacy top level blackfriday config.
|
||||
err := mapstructure.WeakDecode(bm, &conf.BlackFriday)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
if conf.BlackFriday.FootnoteAnchorPrefix == "" {
|
||||
conf.BlackFriday.FootnoteAnchorPrefix = cfg.GetString("footnoteAnchorPrefix")
|
||||
}
|
||||
|
||||
if conf.BlackFriday.FootnoteReturnLinkContents == "" {
|
||||
conf.BlackFriday.FootnoteReturnLinkContents = cfg.GetString("footnoteReturnLinkContents")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
var Default = Config{
|
||||
DefaultMarkdownHandler: "goldmark",
|
||||
|
||||
|
@ -110,8 +83,6 @@ var Default = Config{
|
|||
Highlight: highlight.DefaultConfig,
|
||||
|
||||
Goldmark: goldmark_config.Default,
|
||||
BlackFriday: blackfriday_config.Default,
|
||||
|
||||
AsciidocExt: asciidocext_config.Default,
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue