- Issue created by @giordy
I can't seem to reproduce this. Please add the complete steps to reproduce to the issue summary. Using a site like https://simplytest.me is a way to create a clean Drupal site for bug reproduction.
Also, see if you can reproduce the bug with the CKEditor 5 demo so we can understand if this is CKEditor or a Drupal filter causing it.
- 🇮🇹Italy giordy
1. https://simplytest.me/ does not work: There was a build error 60%
2. CKEditor 5 demo: the problem does not reproduce.
3. I create the page https://prova.gmpe.it/tettonica/attivita-sismica-vulcanica
4. In the source code I insert:<p class="text-align-center"> <a class="glightbox" href="/sites/default/files/tettonica/tectonics_map.gif"><img src="/sites/default/files/tettonica/vulcani.png" width="651" height="223"></a> </p>
5. I save.
6. I check the source code:<p class="text-align-center"> <a href="/sites/default/files/tectonica/tectonics_map.gif"><img class="glightbox" src="/sites/default/files/tectonica/vulcani.png" width="651" height="223"></a> </p>
7. The problem occurs in all pages with the glightbox class
8. In text formats there are no filters for glightbox I continue not to be able to reproduce this bug. Here is what it did:
- Installed a new Drupal 11 site.
- Added an article.
- For the body field I selected Text Format: Full HTML.
- I switched the editor to source mode.
- I pasted the HTML given in the issue summary.
- I saved the node.
- I examined the HTML. There are no changes.
- I edited the node.
- I switched the editor to source mode.
- I examined the HTML. There are no changes.
Because you have a site that can reproduce the bug we need much more detail about how CKEditor and the text formats are configured.
- 🇮🇹Italy giordy
Attached are the images of the buttons and filters, unfortunately in Italian, of full_html.
Instead of modifying the existing pages, I repeat the procedure on a new page: https://prova.gmpe.it/prove.
1. I insert an image with IMCE
2. I connect the image with another image
3. In the link I put the glightbox class
4. I save and check if it works: html has not changed
5. In the same page I copy the code of another page that originally had colorbox
6. I replace colorbox with glightbox
7. I save and check if it works: html has changed, the class has been moved from the link to the imageIn the same page I have two images, one works and the other does not. Absurd!
Practically, it only works on new images and not on existing ones.
Unfortunately I have to replace all the colorbox in the site with glightbox because Colorbox Inline module it looks like it won't be there for drupal 11.Thanks for your patience
- 🇮🇹Italy giordy
I found the problem: it's the p tag
It works if I put:
<a class="glightbox" href="/sites/default/files/tettonica/tectonics_map.gif"><img src="/sites/default/files/tettonica/vulcani.png" data-entity-uuid="" data-entity-type="file" alt="distribuzione di vulcani e terremoti" width="651" height="223"></a>
If instead I put:
<p class="text-align-center"> <a class="glightbox" href="/sites/default/files/tettonica/tectonics_map.gif"><img src="/sites/default/files/tettonica/vulcani.png" data-entity-uuid="" data-entity-type="file" alt="distribuzione di vulcani e terremoti" width="651" height="223"></a> </p>
CKEditor moves the class and shows the wrong image:
<p class="text-align-center"> <a href="/sites/default/files/tettonica/tectonics_map.gif"><img class="glightbox" src="/sites/default/files/tettonica/vulcani.png" data-entity-uuid="" data-entity-type="file" alt="distribuzione di vulcani e terremoti" width="651" height="223"></a> </p>
Unfortunately without the p tag I don't know how to center the images.
Thanks and best regards
- 🇮🇹Italy giordy
I found a way to center the images, so the problem is circumvented by avoiding putting the p and div tags.
Kind regards