diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-02 08:31:23 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2019-12-02 14:12:23 +0100 |
commit | 40a092b0687d44ecb53ef1fd53001a6299345780 (patch) | |
tree | 2a5047d0affd152da90a8e3105fa12ad470989b2 /markup/highlight/config.go | |
parent | d534ce9424c952800dfb26c2faff2d47e9597cad (diff) |
markup: Reimplement pygmentsCodefencesGuessSyntax
Fixes #6565
Diffstat (limited to 'markup/highlight/config.go')
-rw-r--r-- | markup/highlight/config.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/markup/highlight/config.go b/markup/highlight/config.go index 56e38fd85..3f31e65ea 100644 --- a/markup/highlight/config.go +++ b/markup/highlight/config.go @@ -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 |