diff options
author | Jeremy Kun <j2kun@users.noreply.github.com> | 2024-01-06 08:53:24 -0800 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-01-26 08:11:35 +0100 |
commit | d0d2c6795e0870bf96d167700a475737a17ea005 (patch) | |
tree | fdbe228ac133d55e3b1bf23c44adc6c3407557c1 /markup/goldmark/goldmark_config/config.go | |
parent | 2dd608378d450fe7ff5c61af09e05a034628ed2e (diff) |
markup/goldmark: Support passthrough extension
Fixes #10894
Diffstat (limited to 'markup/goldmark/goldmark_config/config.go')
-rw-r--r-- | markup/goldmark/goldmark_config/config.go | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/markup/goldmark/goldmark_config/config.go b/markup/goldmark/goldmark_config/config.go index cdfb4e7cc..ba1874a18 100644 --- a/markup/goldmark/goldmark_config/config.go +++ b/markup/goldmark/goldmark_config/config.go @@ -49,6 +49,13 @@ var Default = Config{ EastAsianLineBreaksStyle: "simple", EscapedSpace: false, }, + Passthrough: Passthrough{ + Enable: false, + Delimiters: DelimitersConfig{ + Inline: [][]string{}, + Block: [][]string{}, + }, + }, }, Renderer: Renderer{ Unsafe: false, @@ -75,6 +82,7 @@ type Extensions struct { Typographer Typographer Footnote bool DefinitionList bool + Passthrough Passthrough // GitHub flavored markdown Table bool @@ -112,6 +120,28 @@ type Typographer struct { Apostrophe string } +// Passthrough hold passthrough configuration. +// github.com/hugoio/hugo-goldmark-extensions/passthrough +type Passthrough struct { + // Whether to enable the extension + Enable bool + + // The delimiters to use for inline and block passthroughs. + Delimiters DelimitersConfig +} + +type DelimitersConfig struct { + // The delimiters to use for inline passthroughs. Each entry in the list + // is a size-2 list of strings, where the first string is the opening delimiter + // and the second string is the closing delimiter, e.g., + // + // [["$", "$"], ["\\(", "\\)"]] + Inline [][]string + + // The delimiters to use for block passthroughs. Same format as Inline. + Block [][]string +} + type CJK struct { // Whether to enable CJK support. Enable bool |