Skip to content

Instantly share code, notes, and snippets.

@billmei
billmei / strikethrough.js
Last active March 31, 2021 09:11
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
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̵"