3 ms·
Sorry for my ignorance, but why do you need to replace "<" and ">" etc with "<" etc? If I am not wrong: - When the user input is plaintext, you will output usi
by SCLeo 5y ago
Sorry for my ignorance, but why do you need to replace "<" and ">" etc with "<" etc? If I am not wrong:
- When the user input is plaintext, you will output using .innerText, which means such replacement will actually break those special characters.
- When the user input is actual html (or contenteditable), such replacement will also break those tags. If you don't want tags in the first place, why make so that user inputs html?