markup: Reimplement pygmentsCodefencesGuessSyntax

Fixes #6565
This commit is contained in:
Bjørn Erik Pedersen
2019-12-02 08:31:23 +01:00
parent d534ce9424
commit 40a092b068
10 changed files with 74 additions and 9 deletions

View File

@@ -58,6 +58,8 @@ type Config struct {
// TabWidth sets the number of characters for a tab. Defaults to 4.
TabWidth int
GuessSyntax bool
}
func (cfg Config) ToHTMLOptions() []html.Option {
@@ -104,6 +106,10 @@ func ApplyLegacyConfig(cfg config.Provider, conf *Config) error {
conf.CodeFences = cfg.GetBool("pygmentsCodeFences")
}
if conf.GuessSyntax == DefaultConfig.GuessSyntax && cfg.IsSet("pygmentsCodefencesGuessSyntax") {
conf.GuessSyntax = cfg.GetBool("pygmentsCodefencesGuessSyntax")
}
if cfg.IsSet("pygmentsOptions") {
if err := applyOptionsFromString(cfg.GetString("pygmentsOptions"), conf); err != nil {
return err