Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] tools: classify \uFEFF as whitespace for translations
Versions -------- - 15.0 - 16.0 - 17.0 - saas-17.1 - saas-17.2 Issue ----- Commit 9426ee5 introduced the \uFEFF character to web_editor as a zero-width non-breaking whitespace. When this gets added to a HTML node, and processed for translation, it throws an "empty document" error. Cause ----- When passed to the `get_text_content` function, the call to `html.fromstring('\uFEFF').text_content()` throws an error. \uFEFF is not technically classified as whitespace, so the `nonspace` function which attempts to prevent processing empty documents doesn't catch it. Solution -------- Instead of the `isspace` method, use a regex which matches on all whitespace as well as \uFEFF. To be applied on stable versions while the origins of stray ZWNBSPs get tackled on master. opw-3957259 closes odoo#171578 X-original-commit: 5e70361 Signed-off-by: Raphael Collet <[email protected]> Signed-off-by: Levi Siuzdak <[email protected]>
- Loading branch information