Completely rewrote the engine. It now uses html-scanner and handles ERB correctly