summaryrefslogtreecommitdiffstats
path: root/markup/goldmark/goldmark_config
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-04-12 10:15:02 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-04-12 14:41:32 +0200
commit5596dc24a0adc8907f52886a8e035e1bcd66dd8d (patch)
tree372bece1601ed69fc92e3925e6183b6a1b9293e2 /markup/goldmark/goldmark_config
parentd01731d53c7c9492cb9666a1223419691a95006c (diff)
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
Diffstat (limited to 'markup/goldmark/goldmark_config')
-rw-r--r--markup/goldmark/goldmark_config/config.go43
1 files changed, 41 insertions, 2 deletions
diff --git a/markup/goldmark/goldmark_config/config.go b/markup/goldmark/goldmark_config/config.go
index ff0b6bbef..f35427ac1 100644
--- a/markup/goldmark/goldmark_config/config.go
+++ b/markup/goldmark/goldmark_config/config.go
@@ -23,7 +23,19 @@ const (
// DefaultConfig holds the default Goldmark configuration.
var Default = Config{
Extensions: Extensions{
- Typographer: true,
+ Typographer: Typographer{
+ Disable: false,
+ LeftSingleQuote: "&lsquo;",
+ RightSingleQuote: "&rsquo;",
+ LeftDoubleQuote: "&ldquo;",
+ RightDoubleQuote: "&rdquo;",
+ EnDash: "&ndash;",
+ EmDash: "&mdash;",
+ Ellipsis: "&hellip;",
+ LeftAngleQuote: "&laquo;",
+ RightAngleQuote: "&raquo;",
+ Apostrophe: "&rsquo;",
+ },
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