Problem/Motivation
I have a view with contextual filters that use a query param for the default value. This is backed by a search api solr backend which can do quoted phrase searching. We've just added this feature and noticed that the search works fine the first time, but when sorting via an AJAX exposed form, it seemingly loses it's quotes.
NB: The query parameter gets there by a custom form which takes user input and simply dumps it into a query param for various reasons we couldn't use a simple exposed filter.
I've tracked this down to SOLR receiving the escaped version of the string, so searching for "Hello world"
would result in "Hello world"
being set in the JS settings in views_views_pre_render and being used in subsequent AJAX requests.
It looks like this escaping was added in #2545972: Remove all code usages SafeMarkup::checkPlain() and rely more on Twig autoescaping, and was actually questioned by @dawehner in https://www.drupal.org/project/drupal/issues/2545972#comment-10332739 but never seemed to have been taken out or talked about further (understandable as the patch was huge)
Proposed resolution
I'm not sure? Maybe just remove the Html::escape entirely?
Remaining tasks
Tests, confirm approach, code.