From 76bf2dcdd23f4cedb425f66503916a58698986dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Thu, 8 Sep 2016 21:23:01 +0200 Subject: Fix shortcode vs pygments This is the nth attempt to fix an issue by changing the placeholder token pattern, but now we actually have tests for all the historic trouble cases. Fixes #2223 --- hugolib/shortcode.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'hugolib/shortcode.go') diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go index 854f89899..88c06baf5 100644 --- a/hugolib/shortcode.go +++ b/hugolib/shortcode.go @@ -204,7 +204,7 @@ func isInnerShortcode(t *template.Template) (bool, error) { } func createShortcodePlaceholder(id int) string { - return fmt.Sprintf("{-{-%s-%d-}-}", shortcodePlaceholderPrefix, id) + return fmt.Sprintf("HAHA%s-%dHBHB", shortcodePlaceholderPrefix, id) } const innerNewlineRegexp = "\n" @@ -528,8 +528,8 @@ func replaceShortcodeTokens(source []byte, prefix string, replacements map[strin sourceLen := len(source) start := 0 - pre := []byte("{-{-" + prefix) - post := []byte("-}-}") + pre := []byte("HAHA" + prefix) + post := []byte("HBHB") pStart := []byte("

") pEnd := []byte("

") -- cgit v1.2.3