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

[Vue] Not all RichText links should be route linked in an embedded implementation #1522

Open
rowantervelde opened this issue Jun 12, 2023 · 4 comments
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug

Comments

@rowantervelde
Copy link

Describe the Bug

Since this PR #1037, all relative links within the content of Vue component ScRichText are interpreted as router links within the Vue application. However, in a "Client-side embedding" implementation, this is not always correct as it's also possible that relative links point to resources outside of the application but still within the same website.

To Reproduce

Use a relative link in the content of a ScRichText component for a resource outside the embedded Vue application.

Expected Behavior

In an embedded implementation, relative links should not all be interpreted as router links. In an ideal scenario, this should be indicated for each link in the content.

Possible Fix

Since it's difficult to indicate within the content of a ScRichText component which relative link is a router link and which isn't, a possible solution could be to use a property on the ScRichText component to specify how relative links should be handled. Either all as router links or all as normal relative links.

Provide environment information

  • Sitecore Version: 10.3
  • JSS Version: 21.1.5
@illiakovalenko
Copy link
Contributor

@rowantervelde Thanks for the detailed information. I've created a ticket in our internal backlog. I've added your details to the ticket as well.

@illiakovalenko illiakovalenko added the backlog Issue/PR/discussion is reviewed and added to backlog for the further work label Jul 4, 2023
@bryandallen
Copy link

@illiakovalenko any information on when we can expect a fix? We're also experiencing this issue where all relative links in the RichText are being route linked. We've found some work arounds for some of our links, but we can't get past the issue where this code is also stripping off the query string if one was present on a relative link that needs it.

@illiakovalenko
Copy link
Contributor

illiakovalenko commented Nov 7, 2023

@bryandallen Let me raise again this issue in our team. Currently, it's in our backlog, and not really prioritized. I will keep you posted

@djsmith
Copy link

djsmith commented Nov 9, 2023

Another problem with the RichText component in how it uses the Vue router for anchor elements is when it has a target="_blank" attribute. RichText's bindRouteLinks function prevents the browser from opening the URL in a new tab/window.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Issue/PR/discussion is reviewed and added to backlog for the further work 🐞 bug
Projects
None yet
Development

No branches or pull requests

4 participants