dargaCode/PalindromeHighlighter

Paste or type text to highlight palindromic words in real time

★ 0Forks 0JavaScriptGitHub ↗Compare

Project website ↗

cssgithtmljavascript

README

PalindromeHighlighter

I’ve written palindrome functions lots of times before, but making this larger app had a lot of interesting challenges.

I wanted to make a site similar to RegExr, where the editing and the highlighting happen in the same box in real time. Turns out I needed to make a second box behind the first box, so I could rewrite the html contents without losing the cursor position. The first box’s background is transparent, to reveal the highlights behind it.

There are a lot of edgecases when it comes to pasting text and converting input to html. I caught every bug I could think of related to pasting html, typing code into the box, and pasting text with the wrong space formatting.

If you manage to break it, please let me know!

Live Webpage

Contributors

dargaCode

Issues