geonetwork / geonetwork/core-geonetwork

Multiple URLs in text join up to create invalid links

Open
#8,169 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
521
Forks
514
Avg merge
6d 13h
Merged PRs (30d)
19

Description

**Describe the bug**
If a record text field contains more than one URL, the URLs and the text between are joined together to form one long broken link.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to Contribute > Add new record
2. Select the template and group then click Create
3. In a multi-line text field, add some text containing two URLs, e.g "This is a link: https://gns.cri.nz and so is this: https://google.com
4. Fill in all the mandatory fields
5. Save and view the new record
6. The multi-line text field has a single link with href="https://gns.cri.nz and so is this: https://google.com"

**Expected behavior**
The multi-line text should have one link per URL in the text.

**Screenshots**
![image](https://github.com/geonetwork/core-geonetwork/assets/1518267/fd50aa76-83af-4279-ba4c-dbe21c8739a0)
![image](https://github.com/geonetwork/core-geonetwork/assets/1518267/9835a887-c341-4b12-96d2-ab25f3ad6f03)
![image](https://github.com/geonetwork/core-geonetwork/assets/1518267/61e42cac-2db2-4cbe-a958-68d24f63b0ac)

**Log file**
N/A

**Desktop (please complete the following information):**
- Browser: Microsoft Edge for Business Version 125.0.2535.92 (Official build) (64-bit)
- GeoNetwork Version: 4.4.2.0
- Server Application: docker container: jdk-11.0.22+7 and Jetty 9.4.54.v20240208

**Additional context**
N/A

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue from Contribute > Add new record using a multi-line text field containing two URLs, then trace the text linkification used when the record is viewed. Done means each URL becomes its own link, with the intervening text excluded from both href values.

Written by the indexing model from the issue text.

Assessment

Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.