a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

add exceptions for mailto and tel prefixes when rewriting url in ButtonBlock

+7 -2
+7 -2
components/Blocks/ButtonBlock.tsx
··· 75 75 }); 76 76 } 77 77 78 - //TODO: exceptions for mailto and tel as well? 79 - if (!urlValue.startsWith("http")) url = `https://${urlValue}`; 78 + // if no valid url prefix, default to https 79 + if ( 80 + !urlValue.startsWith("http") && 81 + !urlValue.startsWith("mailto") && 82 + !urlValue.startsWith("tel:") 83 + ) 84 + url = `https://${urlValue}`; 80 85 81 86 // these mutations = simpler subset of addLinkBlock 82 87 if (!rep) return;