-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #493 from victorlevasseur/upstream_main
fix: the header branch selector now properly encode the branch name as an URI
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
src/main/kotlin/nl/avisi/structurizr/site/generatr/site/model/BranchHomeLinkViewModel.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
package nl.avisi.structurizr.site.generatr.site.model | ||
|
||
import nl.avisi.structurizr.site.generatr.site.asUrlToDirectory | ||
import java.net.URLEncoder | ||
import java.nio.charset.StandardCharsets | ||
|
||
data class BranchHomeLinkViewModel( | ||
private val pageViewModel: PageViewModel, | ||
private val branchName: String | ||
) { | ||
val title get() = branchName | ||
val relativeHref get() = HomePageViewModel.url().asUrlToDirectory(pageViewModel.url) + "../$branchName/" | ||
val relativeHref get() = HomePageViewModel.url().asUrlToDirectory(pageViewModel.url) + "../${URLEncoder.encode(branchName, StandardCharsets.UTF_8)}/" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters