Needs review
Project:
Paste Format (filter, clean-up pasted text)
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
1 Nov 2017 at 14:39 UTC
Updated:
27 Oct 2023 at 18:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
duozerskComment #3
bgilhome commentedI've upgraded this to D8 and it seems to be working fine - review appreciated.
Comment #4
bgilhome commentedComment #5
tfranz commentedI just installed the module and tried it – it seems to work like expected.
Thank you very much for this work!
Two hints for others:
1. You have to select the textformat for pasted text here:
admin/config/content/pasteformat
2. Add the "Paste Format"-Button to the target-CKEditor (Should be mentioned in a future readme.txt).
Comment #6
jonraedeke commentedThank you! This works very well.
Comment #7
zwerg commented#3 works with composer installation like:
But the pasted text looks not cleaned.
Comment #8
tfranz commentedI changed line 4 in pasteformat.info.yml to get it working in Drupal9. And yes: It seems to work quite well ... ;-)
-- core: 8.x
++ core_version_requirement: ^8 || ^9
@zwerg:
You have to use a dedicated textformat to filter the text in the settings-page admin/config/content/pasteformat
"Text format to clean up pasted text" is not the textformat of the editor, but the textformat to filter the text.
I added and selected a simple textformat just for that case (attached an example).
Comment #9
gisleLast post was in 2022, but the reviews are encouraging.
Is anyone still working on upgrading this to Drupal 9 and 10.
I you want help, can help out as a co-maintainer to get this code committed.
Comment #10
jessica.k commentedJust leaving this here as an option for anyone else that comes searching as 9 and 7 slowly reach end of life.
While updating the drupal module code from bgilhome's D8 rewrite to be compatible with D10 is a simple matter, the CKEditor plugin as it exists within the module is only compatible with CKE4 which is being removed in D10 and would need to be rewritten for CKE5. A plugin rewrite was well outside my wheelhouse and the time I have available, so I gave up and went looking for an alternative. The new CKEditor 5 Paste Filter came up which also sanitizes on paste like Paste Format does (imo it's the only user friendly method, it's the reason why I stuck with Paste Format for so long), and is configurable per text format instead of being global. The switch for me was easy since Paste Filter's default configuration cleans everything I was already excluding with Paste Format without also removing anything that I would want to keep, but your mileage may vary on complexity.
CKEditor 5 Paste Filter: https://www.drupal.org/project/ckeditor5_paste_filter
CKeditor Paste Filter, if you're determined to stick with CKE4 as contrib: https://www.drupal.org/project/ckeditor_paste_filter
If you don't like the look of either of those and want to keep trying to rewrite Paste Format, I fully understand and wish you the best of luck. This is just what worked for me and may work for others with the time, resources, and expertise we have available. Much love to everyone who contributed to or left tips for Paste Format in 7, 8, and 9 and made my life as a site maintainer with a bunch of editors so much easier during all those years.