Skip to content

Commit

Permalink
Explain decisions about regex.
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbarnas committed Feb 19, 2021
1 parent dcf1c3f commit 1272144
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/ckeditor5-font/src/fontsize/fontsizeediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}$/
}
},
Expand Down

0 comments on commit 1272144

Please sign in to comment.