markdown: support Smartypants (#4162)

Added new config section '[smartypants]', and disabled by default.
This commit is contained in:
Unknwon
2017-03-10 23:30:40 -05:00
parent 31c55213ff
commit ac8b1e595f
6 changed files with 39 additions and 4 deletions

View File

@@ -153,6 +153,15 @@ var (
FileExtensions []string
}
// Smartypants settings
Smartypants struct {
Enabled bool
Fractions bool
Dashes bool
LatexDashes bool
AngledQuotes bool
}
// Admin settings
Admin struct {
DisableRegularOrgCreation bool
@@ -583,6 +592,8 @@ func NewContext() {
log.Fatal(2, "Fail to map Webhook settings: %v", err)
} else if err = Cfg.Section("markdown").MapTo(&Markdown); err != nil {
log.Fatal(2, "Fail to map Markdown settings: %v", err)
} else if err = Cfg.Section("smartypants").MapTo(&Smartypants); err != nil {
log.Fatal(2, "Fail to map Smartypants settings: %v", err)
} else if err = Cfg.Section("admin").MapTo(&Admin); err != nil {
log.Fatal(2, "Fail to map Admin settings: %v", err)
} else if err = Cfg.Section("cron").MapTo(&Cron); err != nil {