Update wikilink syntax

This prevents interference with markdown tables
This commit is contained in:
2026-05-07 07:55:33 +02:00
parent 0d6aac7844
commit e8c3e53685
3 changed files with 8 additions and 7 deletions
+2 -2
View File
@@ -147,7 +147,7 @@ func validateAndNormalizeNewPath(raw string) (string, error) {
}
// rewriteWikiLinks returns (newContent, changed). Any [[target]] or
// [[target|display]] whose target equals oldPath or begins with oldPath+"/"
// [[target::display]] whose target equals oldPath or begins with oldPath+"/"
// has its target rewritten to the corresponding position under newPath.
func rewriteWikiLinks(content []byte, oldPath, newPath string) ([]byte, bool) {
changed := false
@@ -170,7 +170,7 @@ func rewriteWikiLinks(content []byte, oldPath, newPath string) ([]byte, bool) {
changed = true
suffix := ""
if len(parts[2]) > 0 {
suffix = string(parts[2])
suffix = "::" + string(parts[2])
}
return []byte("[[" + newTarget + suffix + "]]")
})