-
Notifications
You must be signed in to change notification settings - Fork 31
Open
Labels
Description
Description
Not quite sure if this is working as intended and I'm just missing something, but looks like a bug or oversight to me.
The CKEditor content can be accessed as Markdown or plaintext through the FieldData class. But the output still includes encoded HTML entities. For Markdown this is somewhat reasonable, not sure if that's necessary to prevent injection. But for Plaintext, this doesn't make sense. If you want to output something as plaintext, that means it won't be interpreted as HTML, so the HTML entities will appear as-is on screen.
Steps to reproduce
- Enter
Foo & Barin a CKEditor field. - In a template, try to access the value as Markdown or Plaintext:
{{ entry.myCKEditorField }}
{# <p>Foo & Bar</p> #}
{{ entry.myCKEditorField.getMarkdown() }}
{# Foo & Bar #}
{{ entry.myCKEditorField.getPlainText() }}
{# Foo & Bar #}Additional info
- CKEditor version: 4.11.1
- Craft version: 5.9.12
- PHP version: 8.3
Reactions are currently unavailable