mirror of
https://github.com/kovetskiy/mark.git
synced 2026-01-22 10:47:36 +08:00
Clean up comments in normalizeConfluenceWebUIPath
Removed comments from normalizeConfluenceWebUIPath function.
This commit is contained in:
parent
b2efff89e1
commit
0dd5ea9aee
@ -227,19 +227,11 @@ func getConfluenceLink(
|
|||||||
|
|
||||||
// normalizeConfluenceWebUIPath rewrites Confluence Cloud "experience" URLs
|
// normalizeConfluenceWebUIPath rewrites Confluence Cloud "experience" URLs
|
||||||
// ("/ex/confluence/<cloudId>/wiki/..."), to canonical wiki paths ("/wiki/...").
|
// ("/ex/confluence/<cloudId>/wiki/..."), to canonical wiki paths ("/wiki/...").
|
||||||
//
|
|
||||||
// This function is intentionally conservative and only touches the exact
|
|
||||||
// experience prefix, so that local relative paths like "./img/foo.png" are not
|
|
||||||
// impacted.
|
|
||||||
func normalizeConfluenceWebUIPath(path string) string {
|
func normalizeConfluenceWebUIPath(path string) string {
|
||||||
if path == "" {
|
if path == "" {
|
||||||
return path
|
return path
|
||||||
}
|
}
|
||||||
|
|
||||||
// Example:
|
|
||||||
// /ex/confluence/05532958-2d1d-4f01-2027-90926d8b54d5/wiki/spaces/MySpace/pages/2441299827/TEST
|
|
||||||
// ->
|
|
||||||
// /wiki/spaces/MySpace/pages/2441299827/TEST
|
|
||||||
re := regexp.MustCompile(`^/ex/confluence/[^/]+(/wiki/.*)$`)
|
re := regexp.MustCompile(`^/ex/confluence/[^/]+(/wiki/.*)$`)
|
||||||
match := re.FindStringSubmatch(path)
|
match := re.FindStringSubmatch(path)
|
||||||
if len(match) == 2 {
|
if len(match) == 2 {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user