File tree Expand file tree Collapse file tree
packages/bundle/src/markdown/private Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ export function createDecorate(
1717 } )
1818 ) ;
1919
20+ const allowedSchemas = ALLOWED_SCHEMES . map ( scheme => `${ scheme } :` ) ;
21+
2022 return ( href : string , textContent : string ) : BetterLinkDocumentModDecoration => {
2123 const decoration : BetterLinkDocumentModDecoration = {
2224 rel : 'noopener noreferrer' ,
@@ -43,7 +45,7 @@ export function createDecorate(
4345 // eslint-disable-next-line no-script-url
4446 if ( protocol !== 'javascript:' ) {
4547 // For links that would be sanitized out, let's turn them into a button so we could handle them later.
46- if ( ! ALLOWED_SCHEMES . map ( scheme => ` ${ scheme } :` ) . includes ( protocol ) ) {
48+ if ( ! allowedSchemas . includes ( protocol ) ) {
4749 decoration . asButton = true ;
4850
4951 classes . add ( 'render-markdown__citation' ) ;
You can’t perform that action at this time.
0 commit comments