File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ module.exports = md => {
12
12
const link = token . attrs [ hrefIndex ]
13
13
const href = link [ 1 ]
14
14
const isExternal = / ^ h t t p s ? : / . test ( href )
15
- const isSourceLink = / ( \/ | \. m d | \. h t m l ) ( # [ \w - ] * ) ? $ / . test ( href )
15
+ const isSourceLink = / ( \/ | \. m d | \. h t m l ) ( # . * ) ? $ / . test ( href )
16
16
if ( isExternal ) {
17
17
addAttr ( token , 'target' , '_blank' )
18
18
addAttr ( token , 'rel' , 'noopener noreferrer' )
@@ -34,12 +34,13 @@ module.exports = md => {
34
34
35
35
to = to
36
36
. replace ( / \. m d $ / , '.html' )
37
- . replace ( / \. m d ( # [ \w - ] * ) $ / , '.html$1' )
37
+ . replace ( / \. m d ( # . * ) $ / , '.html$1' )
38
38
// normalize links to README/index
39
39
if ( / ^ i n d e x | r e a d m e \. h t m l / i. test ( to ) ) {
40
40
to = '/'
41
41
}
42
- link [ 1 ] = to
42
+ // markdown-it encodes the uri
43
+ link [ 1 ] = decodeURI ( to )
43
44
return Object . assign ( { } , token , {
44
45
tag : 'router-link'
45
46
} )
You can’t perform that action at this time.
0 commit comments