Javascript to replace "~~" to html strikethrough tags.
let string = "~~test string~~"; | |
let i = 0; | |
string = string.replace(new RegExp("~~", 'g'), c => ++i % 2 ? "<s>" : "</s>"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment