Ckeditor5: Editor breaks when setting data with '&' in the content

Created on 28 Oct 2019  ·  4Comments  ·  Source: ckeditor/ckeditor5

Using the & while writing the articles is no problem, saving it and parsing it on the frontend is not problem but when I want to edit an article that as a & anywhere in the content the editor breaks...

Recreate:

  1. Setup React/editor component (npm i @ckeditor/ckeditor5) with firebase.
  2. Write article only an "&" and store editor content with getData() in Firebase.
  3. Edit document by initialising editor with content parsed in the CKEditor.data={Firebase content}.

Schermafdruk 2019-10-28 11 47 45

Schermafdruk 2019-10-28 11 59 07

✔️ Expected result

Expected result is that it would be possible to edit saved data even if there is a & symbol anywhere in the content.

❌ Actual result

Schermafdruk 2019-10-28 11 51 20

📃 Other details

  • Browser: Chrome v77
  • OS: macOS
  • CKEditor version: "@ckeditor/ckeditor5-react": "^1.1.3"
  • Installed CKEditor plugins:
    plugins: [
    Essentials,
    SimpleUploadAdapter,
    Base64UploadAdapter,
    UploadAdapter,
    MathType,
    Bold,
    Italic,
    Subscript,
    Superscript,
    Underline,
    BlockQuote,
    HorizontalRule,
    Heading,
    Image,
    ImageCaption,
    Font,
    ImageStyle,
    Indent,
    IndentBlock,
    ImageToolbar,
    ImageUpload,
    List,
    MediaEmbed,
    Link,
    Paragraph,
    Code,
    PasteFromOffice,
    Table,
    TableToolbar,
    Alignment
    ]

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

feedback duplicate bug

All 4 comments

Maybe some additional webpack config needed?

Hello, thank you for the report. Can you prepare some live example where we'll be able to reproduce this issue?

https://github.com/mstermaaten/test-editor

This is a basic version of my product with fake credentials but using the same configs and packages.

https://objective-blackwell-ced0b4.netlify.com/
username: [email protected]
pw: testing

Ah! I figured this out now – the problem is caused by the MathType plugin. We've just had another bug report about this: https://github.com/ckeditor/ckeditor5/issues/5732.

I'll close this ticket as a DUP of https://github.com/ckeditor/ckeditor5/issues/5732.

Was this page helpful?
0 / 5 - 0 ratings