nshenderov / strapi-plugin-ckeditor

Integrates CKEditor 5 into your Strapi project as a fully customizable custom field. (Unofficial integration)
https://www.npmjs.com/package/@_sh/strapi-plugin-ckeditor
MIT License
84 stars 53 forks source link

Font family supportAllValues is not respected #138

Open timbarclay opened 3 months ago

timbarclay commented 3 months ago

Describe the bug It should be possible to allow only a constrained set of font families and to disallow any others from being used when pasted in by setting the fontFamily.supportAllValues property to false. But setting this property doesn't have any effect.

To Reproduce Install the plugin and use the following custom ckeditor.txt file:

globalThis.CKEditorConfig = {
  configs: {
    toolbar: {
      editorConfig: {
        plugins: [
          CKEditor5.alignment.Alignment,
          CKEditor5.autoformat.Autoformat,
          CKEditor5.image.AutoImage,
          CKEditor5.link.AutoLink,
          CKEditor5.autosave.Autosave,
          CKEditor5.ui.BalloonToolbar,
          CKEditor5.blockQuote.BlockQuote,
          CKEditor5.ui.BlockToolbar,
          CKEditor5.basicStyles.Bold,
          CKEditor5.basicStyles.Code,
          CKEditor5.htmlSupport.DataFilter,
          CKEditor5.htmlSupport.DataSchema,
          CKEditor5.essentials.Essentials,
          CKEditor5.findAndReplace.FindAndReplace,
          CKEditor5.font.FontBackgroundColor,
          CKEditor5.font.FontColor,
          CKEditor5.font.FontFamily,
          CKEditor5.font.FontSize,
          CKEditor5.htmlSupport.GeneralHtmlSupport,
          CKEditor5.heading.Heading,
          CKEditor5.highlight.Highlight,
          CKEditor5.horizontalLine.HorizontalLine,
          CKEditor5.htmlSupport.HtmlComment,
          CKEditor5.htmlEmbed.HtmlEmbed,
          CKEditor5.image.Image,
          CKEditor5.image.ImageCaption,
          CKEditor5.image.ImageResize,
          CKEditor5.image.ImageStyle,
          CKEditor5.image.ImageToolbar,
          CKEditor5.indent.Indent,
          CKEditor5.indent.IndentBlock,
          CKEditor5.basicStyles.Italic,
          CKEditor5.link.Link,
          CKEditor5.link.LinkImage,
          CKEditor5.list.List,
          CKEditor5.list.ListProperties,
          CKEditor5.mediaEmbed.MediaEmbed,
          CKEditor5.mediaEmbed.MediaEmbedToolbar,
          CKEditor5.mention.Mention,
          CKEditor5.pageBreak.PageBreak,
          CKEditor5.paragraph.Paragraph,
          CKEditor5.pasteFromOffice.PasteFromOffice,
          CKEditor5.image.PictureEditing,
          CKEditor5.removeFormat.RemoveFormat,
          CKEditor5.sourceEditing.SourceEditing,
          CKEditor5.specialCharacters.SpecialCharacters,
          CKEditor5.specialCharacters.SpecialCharactersArrows,
          CKEditor5.specialCharacters.SpecialCharactersCurrency,
          CKEditor5.specialCharacters.SpecialCharactersLatin,
          CKEditor5.specialCharacters.SpecialCharactersMathematical,
          CKEditor5.specialCharacters.SpecialCharactersText,
          CKEditor5.strapiPlugins.StrapiMediaLib,
          CKEditor5.strapiPlugins.StrapiUploadAdapter,
          CKEditor5.basicStyles.Strikethrough,
          CKEditor5.basicStyles.Subscript,
          CKEditor5.basicStyles.Superscript,
          CKEditor5.table.Table,
          CKEditor5.table.TableCaption,
          CKEditor5.table.TableCellProperties,
          CKEditor5.table.TableColumnResize,
          CKEditor5.table.TableProperties,
          CKEditor5.table.TableToolbar,
          CKEditor5.basicStyles.Underline,
          CKEditor5.wordCount.WordCount,
        ],
        fontFamily: {
          options: ['Open Sans, sans-serif', 'Georgia, serif'],
          supportAllValues: false,
        },
      },
    },
  },
};

Expected behavior Any custom fonts should be stripped when text is pasted in. Instead, all values are supported.

Screenshots image

This screenshot shows that the fontFamily.options list has been respected, but the supportAllValues property has not.

please complete the following information: