Closed (fixed)
Project:
Bootstrap Buttons (for CKeditor5)
Version:
1.0.x-dev
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Apr 2024 at 13:50 UTC
Updated:
19 Oct 2024 at 10:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
shra commentedIt looks like you have one anchor container inside of another one. Check your HTML for unclosed tags.
Comment #3
arialblack commentedNope, I faced with same issue. It happens when the button (link) has more than one class name, for example, 'btn btn-primary'. And its ok when link have only one class name.
1. Add button - looks ok.
2. Save node and observe how button is rendered - looks ok
3. Edit same node - you will noticed nested
<a>tags in inspectorAnd its doesn't reproduced if to disable this plugin, and insert button from the styles dropdown: https://i.imgur.com/jsso0Ph.png & https://i.imgur.com/du9nYOM.png
Comment #4
ravi kant commentedThe issue may appear due to some other elements not properly closing.
The issue may be debugging on the website.
Comment #5
ravi kant commentedComment #6
ethantSame issue here. This is a critical bug.
Comment #7
shra commentedGuys, could you please share more details. ArialBlack, could you please post here an example of old html which doesn't work? And also provide /admin/config/content/formats settings for "Bootstrap Buttons" plugin.
It is necessary to take in account: this is an expected button template -
<a class="btn OTHER-CLASSES" href="#"><span class="text">button</span></a>You may configure expected classes here /admin/config/content/formats for each text format to cover all classes you used for button
<a>and also class for<span>container. All unregistered classes will be removed by cke5.Comment #8
arialblack commentedI recorded the video: https://youtu.be/gL98gRLOJW8
Comment #9
shra commentedThanks, ArialBlack for the video!
I tested few cases so far, and this is nor "Convert URLs into links" nor "Linkit URL converter". I use them both, by the way, no issues.
If it is possible, can you additionally provide full list of used modules (at least ckeditor related)? I see there are many filters, but i am not familiar with all of them.
Comment #10
arialblack commentedHm...let my try to test again
Comment #11
taote commentedSame thing happening here. Drupal 10.3 version and the following CKEditor modules installed:
Comment #12
shra commentedFinally i have reproduced the bug. As a fix i released next verstion 1.0.8.
@taote @ArialBlack @EthanT Please test on your side and give me a feedback.
Comment #13
arialblack commented@shra I can confirm that problem is gone in 1.0.8. Great!
Comment #14
godotislateI was experiencing the same problem on 1.0.8 with links that had "target" attributes as well. Here's a patch.This patch does not work.
Comment #15
godotislateFollowing up on #14, after more investigation, I found that that patch does not work, so, first, I am providing a new patch that does work as far as I have test.
The steps to reproduce the issue with the 'target' attribute include also having the Editor Advanced Link module installed and configured.
Steps:
<a target="_blank">)" boxIt is now wrapped with additional a tags with the target attribute:
Solution in the patch makes sure to consume the "target" attribute during upcast conversion, so that other plugins do not act on it.
Comment #16
shra commentedComment #17
shra commentedIt seems we have this fixed.
Thank you all, guys!
Let's make Drupal great again :)