Can't add class attribute to hr

Created on 1 September 2023, 10 months ago
Updated 20 March 2024, 3 months 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 <hr class id> to the Source editing, Manually editable HTML tags field of a Text format, then add id or class attributes to
an hr tag in the source of a Ckeditor field. Clear cache.

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

.
πŸ› Bug report
Status

Closed: works as designed

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 5 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

Production build 0.69.0 2024