Problem/Motivation

A Link element should only have a "title" attribute if the "title" variable is defined or the "target" variable is set to "blank". If the "title" is undefined or the "target" attribute is not present, then the "title" attribute should not be returned. Currently, the Link pattern is configured to return an empty "title" attribute when the "target" variable is either empty or other than "blank".

Steps to reproduce

  1. Prepare four links.
  2. For each link, define one of the possible values for the "target" variable (self, parent, blank), and for the last link, do not define the "target" variable.
  3. Inspect the HTML markup of the links.
  4. The "title" attribute should be rendered incorrectly for all the links, except for the link with a "target" attribute set to "blank".

Proposed resolution

Fix the title attribute handling in the Twig file of the pattern.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

spryah created an issue. See original summary.

spryah’s picture

Issue summary: View changes

bhupendra_raykhere’s picture

Status: Active » Needs review
keshavv’s picture

Status: Needs review » Reviewed & tested by the community

@spryah I am able to reproduce the issue, Confirmed that given MR works Well.
We can merge it.

pdureau made their first commit to this issue’s fork.

pdureau’s picture

Title: Fix title attribute handling in link pattern » [beta4] Fix title attribute handling in link pattern
Status: Reviewed & tested by the community » Fixed

Merged

  • pdureau committed 005fd169 on 1.0.x authored by spryah
    Issue #3381515 by spryah: fix "title" attribute handling on link pattern
    

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.