diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-10 20:54:50 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-03-11 20:21:06 +0100 |
commit | 2f2ea42c091931fe4735e0ca7b37dc05cb8c044b (patch) | |
tree | ca1d5fa25acf4d955936c2f9f3f8536edca4176a /hugolib/shortcode_test.go | |
parent | 5f443bd45bd63c10796fc340985fddf218c7ef0d (diff) |
hugolib: Fix reloading corner cases for shortcodes
This commit fixes two different, but related issues:
1) Live-reload when a new shortcode was defined in the content file before the shortcode itself was created.
2) Live-reload when a newly defined shortcode changed its "inner content" status.
This commit also improves the shortcode related error messages to include the full path to the content file in question.
Fixes #3156
Diffstat (limited to 'hugolib/shortcode_test.go')
-rw-r--r-- | hugolib/shortcode_test.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/hugolib/shortcode_test.go b/hugolib/shortcode_test.go index fe57d7af1..0b429306e 100644 --- a/hugolib/shortcode_test.go +++ b/hugolib/shortcode_test.go @@ -352,7 +352,8 @@ func TestExtractShortcodes(t *testing.T) { return nil }) - content, shortCodes, err := extractShortcodes(this.input, p) + s := newShortcodeHandler() + content, err := s.extractShortcodes(this.input, p) if b, ok := this.expect.(bool); ok && !b { if err == nil { @@ -371,6 +372,8 @@ func TestExtractShortcodes(t *testing.T) { } } + shortCodes := s.shortcodes + var expected string av := reflect.ValueOf(this.expect) switch av.Kind() { |