Skip to content
Snippets Groups Projects
Commit 4e48c3ce authored by Benjamin Vray's avatar Benjamin Vray Committed by qsm-odoo
Browse files

[FIX] web_editor: allow non-alphabetic unit in data-unit


Allow non-alphabetic unit (like percentage) as data-unit value.

task-2194309

closes odoo/odoo#47325

X-original-commit: 1f3dd221134b7b5e5b0eac0ab2ffe447771998b9
Signed-off-by: default avatarQuentin Smetz (qsm) <qsm@odoo.com>
parent 6bcf02ef
No related branches found
No related tags found
No related merge requests found
......@@ -103,11 +103,11 @@ function _convertNumericToUnit(value, unitFrom, unitTo, cssProp, $target) {
* @returns {Array|null}
*/
function _getNumericAndUnit(value) {
const m = value.trim().match(/^(-?[0-9.]+)(\w*)$/);
const m = value.trim().match(/^(-?[0-9.]+)([A-Za-z% -]*)$/);
if (!m) {
return null;
}
return [m[1], m[2]];
return [m[1].trim(), m[2].trim()];
}
/**
* Checks if two css values are equal.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment