Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URLs with Dashes inside of Layout slots having their url link modified. #2293

Closed
AnAriaEternal opened this issue Aug 16, 2022 · 2 comments
Closed
Labels
Needs: Author Feedback Awaiting response from the original poster of the issue. v4 version 4

Comments

@AnAriaEternal
Copy link

Version used
4.7

Describe the bug
A block of html is stored within a property on a SharePoint item, that is loaded into the search results via a Refineable String that is entered into a layout slot. The html going into the slot is pulled in completely, meaning when viewing the html into debug mode, all of the html is full and complete. However, when that is referenced by getSummary (slot item @root.slots.RelatedContent)}} within a custom results template. Everything is rendering correctly, with the correct formatting and spacing, with one specific exception: URLs that contain four or more dashes have the text next to those first four removed. Links with three dashes are unaffected, those with five or more have the first four removed but the remainder are unaffected.

Examples:

https://URL.sharepoint.com/sites/Site/SitePages/Link-With-Three-Dashes.aspx --> https://URL.sharepoint.com/sites/Site/SitePages/Link-With-Three-Dashes.aspx
https://URL.sharepoint.com/sites/Site/SitePages/Link-With-Four-Dashes-More.aspx --> https://URL.sharepoint.com/sites/Site/SitePages/.aspx 
https://URL.sharepoint.com/sites/Site/SitePages/Link-With-Five-Dashes-Or-More.aspx --> https://URL.sharepoint.com/sites/Site/SitePages/-More.aspx

To Reproduce
Steps to reproduce the behavior:

  1. Have a layout slot filled with html that contains a href tags.
  2. Use getSummary (slot item @root.slots.RelatedContent)}} to print those within search results using a custom templte.
  3. Load everything onto a page and view the generated links.

Expected behavior
The links should all render fully, without url alteration.

Screenshots
image
image
image
image

Desktop (please complete the following information):

  • Browser: Chrome

Additional context
This also applies to other link formats with dashes (such as Microsoft site links.)

@FranckyC
Copy link
Collaborator

Hi @AnAriaEternal. you don't need to use the getSummary helper function. This one is only relevant when you use the default property HitHighlightedSummary. To display your HTML just use the triple curly braces syntax like this:

{{{slot item @root.slots.RelatedContent}}}

@FranckyC FranckyC added Needs: Author Feedback Awaiting response from the original poster of the issue. v4 version 4 labels Aug 22, 2022
wobba added a commit that referenced this issue May 29, 2023
@wobba
Copy link
Collaborator

wobba commented May 29, 2023

Fixed with #3042

@wobba wobba closed this as completed May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Author Feedback Awaiting response from the original poster of the issue. v4 version 4
Projects
None yet
Development

No branches or pull requests

3 participants