tool for removing most HTML from content

Created on 19 July 2023, 12 months ago
Updated 3 October 2023, 9 months ago

There is a Remove Formatting feature that strips out inline styles from content. But is there any way to strip out the HTML more aggressively? Is there a tool in CKEditor that will let me strip out all HTML aside from a few tags I specify?

I know there are ways to filter out tags from the output, but is there a way to strip them from the input?

The use cases is that content editors will be pasting in content from a word processing document. I don't want all the extra div tags and classes to copy over from the Word Processing document. Or, if they do copy over, I want a way to strip them out before I save the item.

Is there any solution that does this, either in core or by installing a contrib module?

💬 Support request
Status

Closed: cannot reproduce

Version

10.1 ✨

Component
CKEditor 5  →

Last updated about 16 hours ago

Created by

🇺🇸United States arnoldbird

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @arnoldbird
  • Status changed to Postponed: needs info 11 months ago
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺

    But is there any way to strip out the HTML more aggressively?

    No.

    But there is explicit support for pasting from Office (Microsoft Word, Apple Numbers, Google Docs, et cetera).

    Is there a tool in CKEditor that will let me strip out all HTML aside from a few tags I specify?

    Yes: configure your text format to only allow certain tags (which is the case by default in ), and then only those tags will be kept.

    It sounds like you're using ?

  • Status changed to Closed: cannot reproduce 9 months ago
  • 🇧🇪Belgium Wim Leers Ghent 🇧🇪🇪🇺
Production build 0.69.0 2024