Can't add class attribute to hr

Created on 1 September 2023, over 1 year ago

Problem/Motivation

You should be able to add id, class, etc., attributes to the hr tag if those attributes have been added to the Source editing, Manually editable HTML tags field.

Steps to reproduce

Add

to the Source editing, Manually editable HTML tags field of a Text format, then add id or class attributes to the source of a Ckeditor field. Clear cache.

Edit a page using the same Text format where you added the

.
πŸ› Bug report
Status

Active

Version

1.0

Component

Miscellaneous

Created by

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

Comments & Activities

  • Issue created by @cobasa
  • πŸ‡¨πŸ‡¦Canada slussier

    Same for me. +1

  • πŸ‡¨πŸ‡¦Canada joelpittet Vancouver

    Has this ever worked? I can't do that using core's filter either, I think this is a ckeditor5 issue

  • Status changed to Closed: works as designed 10 months ago
  • πŸ‡¬πŸ‡§United Kingdom duttonma

    I think I can see the problem here.

    You have shown the values that you have set in 'Manually editable HTML tags' under source editing but, assuming that you have enabled this filter ('Limit allowed HTML tags and correct faulty HTML - editable tag list'), you haven't shown the values that you have set in 'Allowed HTML tags'.

    I suspect that you have added

    to source editing but you haven't added it to 'Allowed HTML tags' and the two work in conjunction. If it isn't in 'Allowed HTML tags' then it won't show when you view the node and that's it !
  • πŸ‡ΊπŸ‡ΈUnited States jasonmacer

    I can confirm that I have

    enabled, as when I try to add it in: Home >Administration >Configuration >Content authoring>Text formats and editors, I get this error: The following tag(s) are already supported by enabled plugins and should not be added to the Source Editing "Manually editable HTML tags" field: Horizontal line (
    ).

    I also do not have the "Limit allowed HTML tags and correct faulty HTML" enabled, yet I am still not able to set a class id an

    element

    Drupal Core Version: 10.2.4

  • πŸ‡ΊπŸ‡ΈUnited States irodriguez

    Has this ever been resolved? I am still experiencing this problem.

  • Status changed to Active 2 months ago
  • πŸ‡¨πŸ‡¦Canada franknoel

    Same issue on 10.3.6, this has not been resolved.

  • πŸ‡ΊπŸ‡ΈUnited States jsweetack

    This is not a problem with your module, it's a problem with Drupal and CKEditor 5. I don't have your module installed on my site, I just happened to see this page when looking for a solution for this issue.

    I'm really not understanding the move to CKEditor 5 with all these issues.

    I purposefully didn't upgrade last year from 4 because of problems like this. I waited until now, and after a year, still so many issues. The "limit allowed tags" previous feature completely tripped me up right off the bat. After figuring out I had to turn it off completely just to make the site work correctly, the first tag I try to add a class to is a simple horizontal rule element.

    And it doesn't work. The content editors of my site use these things all over the place. How am I supposed roll out this upgrade knowing it will break all the styled horizontal rules of any content if any of the editors make and save any changes to said content?

    So you can imagine my frustration when I find there's actually an issue for this one individual element.

    How much faith do you think I have that the rest of this system is going to work?

    Absolutely ridiculous that CKEditor 5 was green lit to go into Drupal core given all the problems STILL not resolved.

Production build 0.71.5 2024