mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:11:48 +00:00
docs: Fix branch prefix detection with dashes (#10965)
* docs: Fix branch prefix detection with dashes It's perfectly cromulent for branch prefixes to include dashes, but the existing regex doesn't handle that possibility and generates malformed links as a result. This adds dashes to the pattern. * Cache bust docs.js Co-authored-by: Ryan Blunden <ryan.blunden@gmail.com>
This commit is contained in:
parent
662ad6a708
commit
cae80e4f9b
@ -124,7 +124,7 @@ window.sgdocs = (() => {
|
||||
return
|
||||
}
|
||||
|
||||
let branchPrefix = urlPath.match(/(@[\d\w\.]+)/)[0]
|
||||
let branchPrefix = urlPath.match(/(@[\d\w\.-]+)/)[0]
|
||||
document.querySelectorAll('#content-nav a').forEach(e => e.setAttribute('href', `/${branchPrefix}${e.getAttribute('href')}`))
|
||||
}
|
||||
|
||||
|
||||
@ -446,7 +446,7 @@
|
||||
{{end}}
|
||||
|
||||
{{define "afterBody"}}
|
||||
<script src="{{asset "docs.js"}}?15"></script>
|
||||
<script src="{{asset "docs.js"}}?16"></script>
|
||||
{{with .Content}}
|
||||
<script>sgdocs.init(breadcrumbs = {{ .Breadcrumbs }});</script>
|
||||
{{else}}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user