Sitecore 9.3 Rich Text Editor Link Expander Issues with Tokens

Vincent Lui
2 min readJul 9, 2020

--

Sitecore 9.1.1 JSS to 9.3 JSS Upgrade

I am currently upgrading a JSS solution from 9.1.1 to 9.3, utilising the JSS Client React SDK Library.
A very common approach with web application, is to use some form of string tokens with content transformation taking place at runtime. A little bit similar to mail merging in a Word Processor.
I must preface here that the Dictionary value for Sitecore JSS does not solve this issue, before any Sitecore developers suggests using Dictionary.

The solution I am working on, has these type of tokens everywhere, including Rich Text fields in Sitecore content that authors use to curate content. The token format that was chosen is #{firstname} #{surname}, with the characters #{, and ending with }.

This all works fine in 9.1.1 without any problems. However, in 9.3, if those token values are used in an anchor tag (aka Link) in the query string portion. the token value is output twice.

Using the blank Sitecore instance Sitecore Betty page as an example, I have edited a link in the Rich Text field with
https://doc.sitecore.net/?#{abc}=#{123}

The output of that link on the page becomes https://doc.sitecore.net/?#{abc}=#{123}##{abc}=#{123}.

Obviously, this incorrect link expansion from the Rich Text field also flows through to the Sitecore JSS Layout Service.

The HTML source view of the link
The final output of the link

Solution

After using DotPeek to reflect the RenderField pipeline, I have noticed that there are some differences between 9.1.1 and 9.3. I have now logged a Sitecore Support ticket. I will update this blog post once I hear anything back from Sitecore Support.
In the mean time, just do not use the same token format as I have in this example to get around the problem. Otherwise, you may have to write some code to overcome that in your presentation (be it normal traditional MVC, or JSS).

Update — Monday 20th July 2020

Sitecore Support has provided me with two workarounds.

  1. Consider using different symbol in palace of ‘#’, e.g. @{abc}
  2. Comment out SetAnchorsPositionInLinks processor:
    <processor type=”Sitecore.Pipelines.RenderField.SetAnchorsPositionInLinks, Sitecore.Kernel” />

The issue can be tracked with reference number 406741.

--

--

Vincent Lui
Vincent Lui

Written by Vincent Lui

Sitecore Technology MVP 2020–2025 | Solution Architect on Sitecore, Akamai, Microsoft Azure | Passionate on DevSecOps Lifecycle

No responses yet