Last active
March 31, 2021 09:11
-
-
Save billmei/8856977 to your computer and use it in GitHub Desktop.
Adds unicode strikethrough characters to your input so that you can post it to comment boxes and social media websites (Facebook, Twitter, etc.) that don't accept HTML tags
This file contains 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
const strikethroughText = text => | |
text.split('').reduce((acc, char) => | |
acc + char + '\u0335', '') | |
// strikethroughText("amazingly few discotheques provide jukeboxes") | |
// "a̵m̵a̵z̵i̵n̵g̵l̵y̵ ̵f̵e̵w̵ ̵d̵i̵s̵c̵o̵t̵h̵e̵q̵u̵e̵s̵ ̵p̵r̵o̵v̵i̵d̵e̵ ̵j̵u̵k̵e̵b̵o̵x̵e̵s̵" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Many thanks for this helpful script - I changed the unicode \u336 to \u335 to have strikethrough for google chrome notifications