File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,8 @@ title: Changelog
1919- Fix restoration of groups/categories including documents, #2801 .
2020- Fixed missed relative paths within markdown link references in documents.
2121- 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 .
2224
2325### Thanks!
2426
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ export abstract class ContextAwareRendererComponent extends RendererComponent {
4141 */
4242 protected urlPrefix = / ^ ( h t t p | f t p ) s ? : \/ \/ / ;
4343
44- private get hostedBaseUrl ( ) {
44+ protected get hostedBaseUrl ( ) {
4545 const url = this . application . options . getValue ( "hostedBaseUrl" ) ;
4646 return ! url || url . endsWith ( "/" ) ? url : url + "/" ;
4747 }
Original file line number Diff line number Diff line change @@ -332,7 +332,11 @@ export class MarkedPlugin extends ContextAwareRendererComponent {
332332 // will be relative links. This will likely have to change with
333333 // the introduction of support for customized routers whenever
334334 // 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+ ) {
336340 token . attrSet ( "target" , "_blank" ) ;
337341 const classes = token . attrGet ( "class" ) ?. split ( " " ) || [ ] ;
338342 classes . push ( "external" ) ;
You can’t perform that action at this time.
0 commit comments