Problem/Motivation

When adding in multiple Glossary terms that share a similar word (i.e. "Agency" and "Agency Director"), the shorter term/first match was being appended on, resulting in "Agency Director Agency", with both "Agency Director" and "Agency" each receiving the proper tooltip but "Agency" not being expected.

Steps to reproduce

  1. Add a glossary
  2. Add two glossary terms that share a word - "Agency" and "Agency Director"
  3. Add a new page with your glossary, and the term "Agency Director" in the text
  4. Observe that it now reads "Agency Director Agency"

Proposed resolution

Update the script to find the first match and move on from there, so it doesn't duplicate.

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

hot_sauce created an issue. See original summary.

hot_sauce’s picture

Issue summary: View changes

m4olivei’s picture

Assigned: hot_sauce » m4olivei
Status: Active » Needs work

Needs some work still to address a regression. I'm going to take a stab at it.

m4olivei’s picture

Assigned: m4olivei » Unassigned
Status: Needs work » Needs review

Ready for review. I adjusted the approach to avoid taking on matchPositions that overlap, preferring the longer match.

m4olivei’s picture

Status: Needs review » Fixed

Merged to 1.0.x

Status: Fixed » Closed (fixed)

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