StrikethroughJS
Manipulate plain text strikethrough chars in Javascript.
Why?
Strikethrough is represented by words with a horizontal line through their center. It implies that the text is wrong and was recently deleted or marked as such. Unlike the HTML's tag, strikethrough text will work when you copy-paste it in to another location. That’s because the strikethrough characters [...] are in plain text. - Saijo George
This library allows you to get rid of this because some fonts doesn't support strikethrough. You will be able to apply strikethrough another way (e.g., in CSS: text-decoration: line-through;
)
Install
npm i strikethrough-js
Usage
Remove strikethrough
var str = removeStrikethrough('1̶2̶3̶7̶8̶9̶€̶');
console.log(str);
Remove strikethrough chars
var str = removeStrikethroughChars('456€ 1̶2̶3̶7̶8̶9̶€̶');
console.log(str);
Get strikethrough chars
var str = getStrikethroughChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
Get remove strikethrough chars
var str = getRemoveStrikethroughChars('456€ (1̶2̶3̶7̶8̶9̶€̶)');
console.log(str);
Testing
npm t
Will use Jest test suites.