Problem/Motivation

The code in hierarchical-term-formatter.html.twig adds space before and after the separator. This means that if separator is set to , (comma followed by space), for example, there will be a space after the word and before the comma. This is not how commas are supposed to be used.

Steps to reproduce

Set separator is set to , . Observer the extra space.

Proposed resolution

Use Twig's whitespace control to remove the extra space in hierarchical-term-formatter.html.twig.

Remaining tasks

Decide if a migration strategy is needed (see "API changes"). Implement.

User interface changes

None.

API changes

People may be relying on the current behaviour. If separator is set to, for example, » (without spaces) rather than » (with spaces), they may not like how it appears.

Data model changes

None.

CommentFileSizeAuthor
#7 After.png172.74 KBkoustav_mondal
#7 Before.png184.21 KBkoustav_mondal
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

liam morland created an issue. See original summary.

sayan_k_dutta’s picture

Assigned: Unassigned » sayan_k_dutta

Working on it.

sayan_k_dutta’s picture

Assigned: sayan_k_dutta » Unassigned
Status: Active » Needs review

Made the changes. Please review.
Also the pipeline was failing as the tests module was incompatible with D11. Made the fix for it. Pipeline is green now.

liam morland’s picture

Thanks for the patch.

It seems to me that the default separator should stay the same so that existing installs do not change.

koustav_mondal’s picture

Assigned: Unassigned » koustav_mondal
koustav_mondal’s picture

Assigned: koustav_mondal » Unassigned
Status: Needs review » Reviewed & tested by the community
StatusFileSize
new184.21 KB
new172.74 KB

Installed the module and tested. Looks good. Attaching screenshot for reference.

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

astonvictor’s picture

Status: Reviewed & tested by the community » Fixed

merged to the dev branch

thanks all

Status: Fixed » Closed (fixed)

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