I had exactly the same issue and solved the problem with the new Summernote extension.
We needed for various reasons to have access to the underlying code (the old 'Source' toggle to see the underlying HTML) and the current version of CKEditor5 available via the CKEditor5 extension did not support it. There was discussion about merging the newer CKEditor5 code in, which does now have a source editor, but as of writing this it was not yet there.
Installation of Summernote is via the command line, but is very straight forward:
Go to your current extensions directory
Download the url defined in the download link. For me this was:
wget -vv https://lab.civicrm.org/extensions/summernote/-/archive/1.2.2/summernote-1.2.2.zip
unzip summernote-1.2.2.zip
enable the extension either through the UI or just run
cv en summernote
if your setup requires you to run this as a particular acount use the--user=my_user
optionGo to Administer -> Customise Data and Screens -> Display Preferences and select Summernote as your WYSIWYG editor:
- Check it works as exepected and then clean up by deleting the downloaded Zip file
That's about it - there are some more options available to look at, but we are using successfully straight out of the box with the defaults. This is where to find the other settings in case you need them.
Administer -> Customise Data and Screens -> Summernote
So now we have a source editor and the elFinder file browser (this replaces kcfinder) working perfectly under Drupal 10 and CiviCRM 5.66.2 (as of writing). Hope this helps as I suspetsuspect many will run into this when upgrading to the latest Drupal.