Create default link and image render hooks

Fixes #11933
This commit is contained in:
Bjørn Erik Pedersen
2024-01-30 11:43:20 +01:00
parent 80595bbe3e
commit 5b7cb258ec
15 changed files with 229 additions and 42 deletions

View File

@@ -387,6 +387,11 @@ func ToSlashTrimLeading(s string) string {
return strings.TrimPrefix(filepath.ToSlash(s), "/")
}
// ToSlashTrimTrailing is just a filepath.ToSlash with an added / suffix trimmer.
func ToSlashTrimTrailing(s string) string {
return strings.TrimSuffix(filepath.ToSlash(s), "/")
}
// ToSlashPreserveLeading converts the path given to a forward slash separated path
// and preserves the leading slash if present trimming any trailing slash.
func ToSlashPreserveLeading(s string) string {