mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-30 22:39:58 +02:00
markup/goldmark: Add config options for the typographer extension
Note that the config per language part of this will be handled in #10602. Updates #9772
This commit is contained in:
@@ -23,7 +23,19 @@ const (
|
||||
// DefaultConfig holds the default Goldmark configuration.
|
||||
var Default = Config{
|
||||
Extensions: Extensions{
|
||||
Typographer: true,
|
||||
Typographer: Typographer{
|
||||
Disable: false,
|
||||
LeftSingleQuote: "‘",
|
||||
RightSingleQuote: "’",
|
||||
LeftDoubleQuote: "“",
|
||||
RightDoubleQuote: "”",
|
||||
EnDash: "–",
|
||||
EmDash: "—",
|
||||
Ellipsis: "…",
|
||||
LeftAngleQuote: "«",
|
||||
RightAngleQuote: "»",
|
||||
Apostrophe: "’",
|
||||
},
|
||||
Footnote: true,
|
||||
DefinitionList: true,
|
||||
Table: true,
|
||||
@@ -54,7 +66,7 @@ type Config struct {
|
||||
}
|
||||
|
||||
type Extensions struct {
|
||||
Typographer bool
|
||||
Typographer Typographer
|
||||
Footnote bool
|
||||
DefinitionList bool
|
||||
|
||||
@@ -66,6 +78,33 @@ type Extensions struct {
|
||||
TaskList bool
|
||||
}
|
||||
|
||||
// Typographer holds typographer configuration.
|
||||
type Typographer struct {
|
||||
// Whether to disable typographer.
|
||||
Disable bool
|
||||
|
||||
// Value used for left single quote.
|
||||
LeftSingleQuote string
|
||||
// Value used for right single quote.
|
||||
RightSingleQuote string
|
||||
// Value used for left double quote.
|
||||
LeftDoubleQuote string
|
||||
// Value used for right double quote.
|
||||
RightDoubleQuote string
|
||||
// Value used for en dash.
|
||||
EnDash string
|
||||
// Value used for em dash.
|
||||
EmDash string
|
||||
// Value used for ellipsis.
|
||||
Ellipsis string
|
||||
// Value used for left angle quote.
|
||||
LeftAngleQuote string
|
||||
// Value used for right angle quote.
|
||||
RightAngleQuote string
|
||||
// Value used for apostrophe.
|
||||
Apostrophe string
|
||||
}
|
||||
|
||||
type Renderer struct {
|
||||
// Whether softline breaks should be rendered as '<br>'
|
||||
HardWraps bool
|
||||
|
Reference in New Issue
Block a user