Skip to content

Commit 98a3ad9

Browse files
committed
fix match pattern for url
1 parent 821caef commit 98a3ad9

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ example2: `http://localhost/root/gitbucket/blob/19f0431a3fb4a9c3560dbf9b1d74f207
4141

4242
## Limitation
4343

44-
Because of path processing, currently this plugin can handle GitBucket which in running without url prefix.
45-
And branch name icludes `/` may occur error.
44+
user name, repo name, branch name includes `/` may occur error.
4645

4746
## Version
4847

src/main/resources/embedding/assets/entry.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ $(function(){
4444
};
4545

4646
function convertLinks(){
47-
var matchPattern = new RegExp('https?://' + location.host + '(/\\w+)?/(\\w+)/(\\w+)/blob/(\\w+)/([\\w\\.]+)#L([0-9]+)(-L[0-9]+)?$');
47+
var matchPattern = new RegExp('https?://' + location.host + '(/[\\w-\\.]+)?/([\\w-\\.]+)/([\\w-\\.]+)/blob/([\\w-\\.]+)/([\\w-\\.]+)#L([0-9]+)(-L[0-9]+)?$');
4848
var elements = $('.markdown-body p a');
4949
var element;
5050
var url;

0 commit comments

Comments
 (0)