Make .RenderString render shortcodes

Fixes #6703
This commit is contained in:
Bjørn Erik Pedersen 2022-05-29 16:41:57 +02:00
parent d2cfaede5b
commit 9e904d756b
No known key found for this signature in database
GPG key ID: 330E6E2BD4859D8F
10 changed files with 315 additions and 111 deletions

View file

@ -107,15 +107,9 @@ title: "Shortcodes Galore!"
t.Parallel()
c := qt.New(t)
counter := 0
placeholderFunc := func() string {
counter++
return fmt.Sprintf("HAHA%s-%dHBHB", shortcodePlaceholderPrefix, counter)
}
p, err := pageparser.ParseMain(strings.NewReader(test.input), pageparser.Config{})
c.Assert(err, qt.IsNil)
handler := newShortcodeHandler(nil, s, placeholderFunc)
handler := newShortcodeHandler(nil, s)
iter := p.Iterator()
short, err := handler.extractShortcode(0, 0, iter)