summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorgllera <[email protected]>2018-08-17 02:17:27 +0200
committerBjørn Erik Pedersen <[email protected]>2018-08-17 09:13:30 +0200
commit78c99463fdd45c91af9933528d12d36a86dc6482 (patch)
tree8920301e2c28725c7d396e5134bba05f8436b3dd
parentabc54080ec8c43e8989c081d934b59f0c9570c0b (diff)
downloadhugo-78c99463fdd45c91af9933528d12d36a86dc6482.tar.gz
hugo-78c99463fdd45c91af9933528d12d36a86dc6482.zip
hugolib: Fix shortcode output wrapped in p
Fixes #1642
-rw-r--r--hugolib/shortcode.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index 8ad539935..c2fcf1b8d 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -670,7 +670,6 @@ func replaceShortcodeTokens(source []byte, prefix string, replacements map[strin
return source, nil
}
- sourceLen := len(source)
start := 0
pre := []byte("HAHA" + prefix)
@@ -694,7 +693,7 @@ func replaceShortcodeTokens(source []byte, prefix string, replacements map[strin
// Issue #1148: Check for wrapping p-tags <p>
if j >= 3 && bytes.Equal(source[j-3:j], pStart) {
- if (k+4) < sourceLen && bytes.Equal(source[end:end+4], pEnd) {
+ if (k+4) < len(source) && bytes.Equal(source[end:end+4], pEnd) {
j -= 3
end += 4
}