diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-01-30 11:43:20 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2024-01-30 20:12:19 +0100 |
commit | 5b7cb258ec26d7de690099f5dc39935b8d728155 (patch) | |
tree | 53544c8ab46e3fffda4a1e33c5d6e705183e2652 /common/paths/path.go | |
parent | 80595bbe3e7901ecd6200e59d43af142c3c85b6b (diff) |
Create default link and image render hooks
Fixes #11933
Diffstat (limited to 'common/paths/path.go')
-rw-r--r-- | common/paths/path.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/common/paths/path.go b/common/paths/path.go index da99b16ac..906270cae 100644 --- a/common/paths/path.go +++ b/common/paths/path.go @@ -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 { |