mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-18 21:11:19 +02:00
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
This commit is contained in:
committed by
GitHub
parent
ccb3040ad4
commit
76bf2dcdd2
@@ -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>")
|
||||
|
||||
|
Reference in New Issue
Block a user