Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font family supportAllValues is not respected #138

Closed
timbarclay opened this issue Mar 26, 2024 · 1 comment
Closed

Font family supportAllValues is not respected #138

timbarclay opened this issue Mar 26, 2024 · 1 comment

Comments

@timbarclay
Copy link

timbarclay commented Mar 26, 2024

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:

  • package.json
{
  "name": "cms",
  "version": "0.1.0",
  "private": true,
  "description": "A Strapi application",
  "license": "MIT",
  "author": {
    "name": "A Strapi developer"
  },
  "workspaces": [
    "./src/plugins/preview-button",
    "./src/plugins/treeview",
    "./src/plugins/release-manager"
  ],
  "scripts": {
    "build": "npm run build --workspaces && strapi build",
    "develop": "strapi develop",
    "lint": "eslint \"{src,apps,libs,test}/**/*.ts\"",
    "lint:ci": "npm run lint -- -o testResults/eslint || true",
    "lint:fix": "npm run lint -- --fix",
    "start": "strapi start",
    "strapi": "strapi",
    "pretest": "npm run build --workspaces",
    "test": "jest -i --detectOpenHandles",
    "test:ci": "npm run test -- --ci --reporters=default --reporters=jest-junit",
    "test:ci:all": "npm run lint:ci ; npm run test:ci",
    "test:cov": "npm run test -- --coverage",
    "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
    "test:unit-ci": "npm run test:cov -- --ci --reporters=default --reporters=jest-junit"
  },
  "jest-junit": {
    "outputDirectory": "testResults",
    "uniqueOutputName": "true"
  },
  "dependencies": {
    "@_sh/strapi-plugin-ckeditor": "^2.1.1",
    "@aws-sdk/client-s3": "^3.377.0",
    "@nestjs/common": "^10.1.2",
    "@notum-cz/strapi-plugin-content-versioning": "^1.2.9",
    "@strapi/plugin-i18n": "~4.15.0",
    "@strapi/plugin-users-permissions": "~4.15.0",
    "@strapi/provider-email-amazon-ses": "~4.15.0",
    "@strapi/provider-upload-aws-s3": "~4.15.0",
    "@strapi/strapi": "~4.15.0",
    "aws-sdk": "^2.1438.0",
    "axios": "^1.4.0",
    "csv-parser": "^3.0.0",
    "fs": "^0.0.1-security",
    "pdf.js-extract": "^0.2.1",
    "pg": "8.8.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-router-dom": "^5.3.4",
    "sqs-consumer": "^7.2.2",
    "strapi-plugin-populate-deep": "^3.0.0",
    "styled-components": "^5.3.11",
    "unzip-stream": "^0.3.1",
    "unzipit": "^1.4.3"
  },
  "devDependencies": {
    "@aws-sdk/util-stream-node": "^3.374.0",
    "@testing-library/react": "^14.0.0",
    "@testing-library/user-event": "^14.5.1",
    "@types/jest": "^29.5.3",
    "@types/supertest": "^2.0.12",
    "@typescript-eslint/eslint-plugin": "^5.59.7",
    "@typescript-eslint/parser": "^5.59.7",
    "aws-sdk-client-mock": "^3.0.0",
    "aws-sdk-client-mock-jest": "^3.0.0",
    "eslint": "^8.46.0",
    "eslint-config-prettier": "^8.8.0",
    "eslint-plugin-prettier": "^4.2.1",
    "jest": "^29.6.3",
    "jest-junit": "^16.0.0",
    "nock": "^13.3.3",
    "prettier": "^2.8.8",
    "sqlite3": "^5.1.6",
    "supertest": "^6.3.3",
    "testcontainers": "^10.2.1",
    "ts-jest": "^29.1.1",
    "ts-node": "^10.9.1",
    "uuid": "^9.0.0"
  },
  "engines": {
    "node": ">=14.19.1 <=18.x.x",
    "npm": ">=6.0.0"
  },
  "strapi": {
    "uuid": "a6a9bfb9-2120-436d-a040-39f4f2e87023"
  }
}
  • node version - v18.17.1
@nshenderov
Copy link
Owner

This is not related to the plugin integration but to CKEditor itself. The config gets delivered properly.

@nshenderov nshenderov closed this as not planned Won't fix, can't repro, duplicate, stale Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants