diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-05 13:52:00 +0300 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2020-01-05 13:56:05 +0300 |
commit | 16e7c1120346bd853cf6510ffac8e94824bf2c7f (patch) | |
tree | e1f1c38bdf978015d8e9fd81e3c5c51d18fff327 /markup/goldmark/convert_test.go | |
parent | 8f071fc159ce9a0fc0ea14a73bde8f299bedd109 (diff) |
markup/goldmark: Add an optional Blackfriday auto ID strategy
Fixes #6707
Diffstat (limited to 'markup/goldmark/convert_test.go')
-rw-r--r-- | markup/goldmark/convert_test.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/markup/goldmark/convert_test.go b/markup/goldmark/convert_test.go index 3c173fb0a..31799b2a5 100644 --- a/markup/goldmark/convert_test.go +++ b/markup/goldmark/convert_test.go @@ -178,6 +178,21 @@ func TestConvertAutoIDAsciiOnly(t *testing.T) { c.Assert(got, qt.Contains, "<h2 id=\"god-is-good-\">") } +func TestConvertAutoIDBlackfriday(t *testing.T) { + c := qt.New(t) + + content := ` +## Let's try this, shall we? + +` + mconf := markup_config.Default + mconf.Goldmark.Parser.AutoHeadingIDType = goldmark_config.AutoHeadingIDTypeBlackfriday + b := convert(c, mconf, content) + got := string(b.Bytes()) + + c.Assert(got, qt.Contains, "<h2 id=\"let-s-try-this-shall-we\">") +} + func TestCodeFence(t *testing.T) { c := qt.New(t) |