mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-05 04:56:02 +01:00
(refs #713)Fix anchor to headline in Wiki
This commit is contained in:
@@ -123,8 +123,10 @@ class GitBucketHtmlSerializer(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private def fixUrl(url: String, isImage: Boolean = false): String = {
|
private def fixUrl(url: String, isImage: Boolean = false): String = {
|
||||||
if(url.startsWith("http://") || url.startsWith("https://") || url.startsWith("#") || url.startsWith("/")){
|
if(url.startsWith("http://") || url.startsWith("https://") || url.startsWith("/")){
|
||||||
url
|
url
|
||||||
|
} else if(url.startsWith("#")){
|
||||||
|
("#" + GitBucketHtmlSerializer.generateAnchorName(url.substring(1)))
|
||||||
} else if(!enableWikiLink){
|
} else if(!enableWikiLink){
|
||||||
if(context.currentPath.contains("/blob/")){
|
if(context.currentPath.contains("/blob/")){
|
||||||
url + (if(isImage) "?raw=true" else "")
|
url + (if(isImage) "?raw=true" else "")
|
||||||
|
|||||||
Reference in New Issue
Block a user