Created
September 3, 2021 15:58
-
-
Save samermurad/5b1262e7622cc6683251fa03676e816f to your computer and use it in GitHub Desktop.
Fixes the Links to Carbon.now.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fixMediumLink(link) { | |
const text = document.createElement('input') | |
text.value = encodeURI(link.replace('sh/embed', 'sh').replace(/sh\/?/, 'sh/embed')) | |
text.select(); | |
document.execCommand("copy"); | |
return text.value | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment