Code review comment for lp:~pieq/checkbox/fix-1585556-sanitizing-comments

Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

The current CONTROL_CODE_RE_STR does not seem to clean the string from escape sequences (especially those ending with arrow/pagedown).

I'd try to add a new regex for a two step cleanup using this time this one:

'(\x9B|\x1B\[)[0-?]*[ -\/]*[@-~]'

Credits: http://stackoverflow.com/a/33925425/1154487

And we need a new unit test to check it works (and not regress)

review: Needs Fixing

« Back to merge proposal