Descriptions containing links break admin menu lists.

Created on 17 March 2016, over 9 years ago
Updated 13 June 2025, 15 days ago

Problem/Motivation

If a content type description contains an <a> tag it results in a broken display of the Add content administration page when using the Seven theme.

Steps to reproduce:

  1. Spin up a sandbox site on SimplyTest.me: http://ply.st/drupal/8.0.x
  2. Install as Standard Drupal 8 profile with default configuration.
  3. Navigate to the Add content type page: admin/structure/types/add
  4. Add a new content type with the following settings:
    • Name: Test
    • Description: Test with <a href="https://drupal.org">Link</a>
  5. Navigate to the Add content page: node/add

This is present in the following templates:

  • admin-block-content.html.twig
  • block-content-add-list.html.twig
  • node-add-list.html.twig

The issue is due to the description variable being wrapped with an anchor tag, which causes the DOM to be re-arranged to comply with standards.

Proposed resolution

  1. Remove the wrapping anchor tag; Potentially cause a regression issue with #1488962: Increase touch target size of admin menu lists
  2. Sanitize the Description variable, removing anchor tags; Potentially reduce usability
  3. Replicate the wrapping anchor tag with Javascript; Potentially cause an issue for non-JS users

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

🇦🇺Australia deciphered

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024