File tree 3 files changed +8
-2
lines changed
3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ title: Changelog
19
19
- Fix restoration of groups/categories including documents, #2801 .
20
20
- Fixed missed relative paths within markdown link references in documents.
21
21
- Improved handling of incomplete inline code blocks within markdown.
22
+ - Direct ` https:// ` links under the ` hostedBaseUrl ` option's URL will no
23
+ longer be treated as external, #2809 .
22
24
23
25
### Thanks!
24
26
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export abstract class ContextAwareRendererComponent extends RendererComponent {
41
41
*/
42
42
protected urlPrefix = / ^ ( h t t p | f t p ) s ? : \/ \/ / ;
43
43
44
- private get hostedBaseUrl ( ) {
44
+ protected get hostedBaseUrl ( ) {
45
45
const url = this . application . options . getValue ( "hostedBaseUrl" ) ;
46
46
return ! url || url . endsWith ( "/" ) ? url : url + "/" ;
47
47
}
Original file line number Diff line number Diff line change @@ -332,7 +332,11 @@ export class MarkedPlugin extends ContextAwareRendererComponent {
332
332
// will be relative links. This will likely have to change with
333
333
// the introduction of support for customized routers whenever
334
334
// that becomes a real thing.
335
- if ( this . markdownLinkExternal && / h t t p s ? : \/ \/ / i. test ( href ) ) {
335
+ if (
336
+ this . markdownLinkExternal &&
337
+ / h t t p s ? : \/ \/ / i. test ( href ) &&
338
+ ! ( href + "/" ) . startsWith ( this . hostedBaseUrl )
339
+ ) {
336
340
token . attrSet ( "target" , "_blank" ) ;
337
341
const classes = token . attrGet ( "class" ) ?. split ( " " ) || [ ] ;
338
342
classes . push ( "external" ) ;
You can’t perform that action at this time.
0 commit comments