summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-09-08 21:23:01 +0200
committerGitHub <noreply@github.com>2016-09-08 21:23:01 +0200
commit76bf2dcdd23f4cedb425f66503916a58698986dd (patch)
tree8e37dabbfdaaa7e9694cfe76baaa66066ad9218c /hugolib/shortcode.go
parentccb3040ad4471de0b6b513289994ccc7dd70b333 (diff)
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
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go6
1 files changed, 3 insertions, 3 deletions
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("<p>")
pEnd := []byte("</p>")