mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +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:
@@ -499,3 +499,18 @@ LINE5
|
||||
c.Assert(result, qt.Contains, "<span class=\"ln\">2</span><span class=\"cl\">LINE2\n</span></span>")
|
||||
})
|
||||
}
|
||||
|
||||
func TestTypographerConfig(t *testing.T) {
|
||||
c := qt.New(t)
|
||||
|
||||
content := `
|
||||
A "quote" and 'another quote' and a "quote with a 'nested' quote" and a 'quote with a "nested" quote' and an ellipsis...
|
||||
`
|
||||
mconf := markup_config.Default
|
||||
mconf.Goldmark.Extensions.Typographer.LeftDoubleQuote = "«"
|
||||
mconf.Goldmark.Extensions.Typographer.RightDoubleQuote = "»"
|
||||
b := convert(c, mconf, content)
|
||||
got := string(b.Bytes())
|
||||
|
||||
c.Assert(got, qt.Contains, "<p>A «quote» and ‘another quote’ and a «quote with a ’nested’ quote» and a ‘quote with a «nested» quote’ and an ellipsis…</p>\n")
|
||||
}
|
||||
|
Reference in New Issue
Block a user