From 1272144fdb6c3607c1ea33792d25164271477c54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maksymilian=20Barna=C5=9B?= Date: Fri, 19 Feb 2021 09:24:26 +0100 Subject: [PATCH] Explain decisions about regex. --- packages/ckeditor5-font/src/fontsize/fontsizeediting.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/ckeditor5-font/src/fontsize/fontsizeediting.js b/packages/ckeditor5-font/src/fontsize/fontsizeediting.js index f9614ebd2c3..fab82d822dc 100644 --- a/packages/ckeditor5-font/src/fontsize/fontsizeediting.js +++ b/packages/ckeditor5-font/src/fontsize/fontsizeediting.js @@ -164,8 +164,9 @@ export default class FontSizeEditing extends Plugin { view: { name: 'font', attributes: { - // Documentation mentions sizes from 1 to 7. - // To handle old content we support all values up to 999 (arbitrarily picked) but clamp it to the valid range. + // Documentation mentions sizes from 1 to 7. To handle old content we support all values + // up to 999 but clamp it to the valid range. Why 999? It should cover accidental values + // similar to percentage, e.g. 100%, 200% which could be the usual mistake for font size. 'size': /^[+-]?\d{1,3}$/ } },