Skip to content

Commit f2e1d7f

Browse files
committed
Fix schemas
1 parent 4779b84 commit f2e1d7f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

packages/bundle/src/markdown/private/createDecorate.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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');

0 commit comments

Comments
 (0)