This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,7 @@ matrixLinkify.options = {
255255 target : function ( href , type ) {
256256 if ( type === 'url' ) {
257257 const transformed = tryTransformPermalinkToLocalHref ( href ) ;
258- if ( transformed !== href || href . match ( matrixLinkify . ELEMENT_URL_PATTERN ) ) {
258+ if ( transformed !== href || decodeURIComponent ( href ) . match ( matrixLinkify . ELEMENT_URL_PATTERN ) ) {
259259 return null ;
260260 } else {
261261 return '_blank' ;
Original file line number Diff line number Diff line change @@ -346,7 +346,7 @@ export function tryTransformPermalinkToLocalHref(permalink: string): string {
346346 return permalink ;
347347 }
348348
349- const m = permalink . match ( matrixLinkify . ELEMENT_URL_PATTERN ) ;
349+ const m = decodeURIComponent ( permalink ) . match ( matrixLinkify . ELEMENT_URL_PATTERN ) ;
350350 if ( m ) {
351351 return m [ 1 ] ;
352352 }
@@ -411,8 +411,8 @@ function getPermalinkConstructor(): PermalinkConstructor {
411411
412412export function parsePermalink ( fullUrl : string ) : PermalinkParts {
413413 const elementPrefix = SdkConfig . get ( ) [ 'permalinkPrefix' ] ;
414- if ( fullUrl . startsWith ( matrixtoBaseUrl ) ) {
415- return new SpecPermalinkConstructor ( ) . parsePermalink ( fullUrl ) ;
414+ if ( decodeURIComponent ( fullUrl ) . startsWith ( matrixtoBaseUrl ) ) {
415+ return new SpecPermalinkConstructor ( ) . parsePermalink ( decodeURIComponent ( fullUrl ) ) ;
416416 } else if ( elementPrefix && fullUrl . startsWith ( elementPrefix ) ) {
417417 return new ElementPermalinkConstructor ( elementPrefix ) . parsePermalink ( fullUrl ) ;
418418 }
You can’t perform that action at this time.
0 commit comments