Allow tags details and summary in the help text instructions presented to the user below editing form field

Created on 12 April 2023, about 1 year ago

Problem/Motivation

HTML tags details and summary currently cannot be used in the Help text instructions presented to the user below fields in the editing form.

To provide descriptive and human-friendly instructions to the content editors, listing specific examples can significantly improve the UX. However, providing more than 3-5 short-value examples takes up much of the UI and reduces usability. Similarly, providing links to some Help Topics โ†’ documentation with examples requires the users to stop adding content and opening a new window (to avoid losing unsaved changes). Making use of standard details and summary HTML tags in the Help text would allow providing additional instruction details in a more user-friendly way by providing the relevant help information where it is needed the most, i.e. when adding the specific field content.

Steps to reproduce

The details and summary HTML tags do not get displayed in the instructions presented to the user below this field on the editing form."

Proposed resolution

Add details and summary HTML tags to the list of allowed tags in the FieldFilteredMarkup::allowedTags() (core/lib/Drupal/Core/Field/FieldFilteredMarkup.php)

/**
   * Returns the allowed tag list.
   *
   * @return string[]
   *   A list of allowed tags.
   */
  public static function allowedTags() {
    return ['a', 'b', 'big', 'code', 'del', 'em', 'i', 'ins', 'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img', 'details', 'summary'];
  }

Remaining tasks

Review patch.

User interface changes

Custom help text would display details and summary HTML tags to show expandable help text content.

Release notes snippet

Add details and summary HTML tags to the list of allowed tags in the FieldFilteredMarkup::allowedTags().

โœจ Feature request
Status

Needs work

Version

10.1 โœจ

Component
UI textย  โ†’

Last updated 3 days ago

No maintainer
Created by

๐Ÿ‡ธ๐Ÿ‡ฆSaudi Arabia martins.bruvelis Thuwal

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs subsystem maintainer review

    It is used to alert the maintainer(s) of a particular core subsystem that an issue significantly impacts their subsystem, and their signoff is needed (see the governance policy draft for more information). Also, if you use this tag, make sure the issue component is set to the correct subsystem. If an issue significantly impacts more than one subsystem, use needs framework manager review instead.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024