Title attribute shows html if any exists in the target node title

Created on 16 February 2024, 8 months ago
Updated 9 May 2024, 5 months ago

Problem/Motivation

The LinkitFilter plugin has the ability to create a title attribute for the link, based on the title of the target node.
If that node's title has markup in it, the link's title attribute will display it. See the screenshot of my test case.

There is no reason for a title attribute to have html in it, so it makes sense to strip these tags out of the derived string.

Steps to reproduce

Create a node with some html in the title - e.g. a simple span will do.

Create another node with a link that points to it.

In the text editor settings used by the target node, set 'Linkit enabled' under the 'Drupal link' Ckeditor settings.
In the corresponding filter settings under 'Linkit URL converter', check 'Automatically set the title attribute to that of the (translated) referenced content'

View the node with the link and hover over it. The html will be displayed.

Proposed resolution

In the LinkitFilter plugin strip the html tags from the string that is assigned to the 'title' attribute.

πŸ› Bug report
Status

Postponed: needs info

Version

7.0

Component

Code

Created by

πŸ‡¨πŸ‡¦Canada User Advocate

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

Comments & Activities

Production build 0.71.5 2024