blacklight_range_limit icon indicating copy to clipboard operation
blacklight_range_limit copied to clipboard

span tag in html/head/title when range selected

Open kosarko opened this issue 2 years ago • 1 comments

With 0a1df5f07a57f1b5b55d61d0e564c53bd17be6c9 (ref I've deployed, probably not the cause) and blacklight 7.25.2 the browser tab title (ie /html/head/title) contains markup when I select a range

ie. after selecting 1590-1943 the title tag looks like this:

<title>Date: &lt;span class="from" data-blrl-begin="1590"&gt;1590&lt;/span&gt; to &lt;span class="to" data-blrl-end="1943"&gt;1943&lt;/span&gt; - Blacklight Search Results</title>

this has changed since v8.1.0 (on blacklight (7.22.2)) where the range value was not present at all

kosarko avatar Jun 03 '22 14:06 kosarko

The main page title logic is in the main blacklight library. What's happening here is that the range selector is a "normal" filter configuration now, but the title helper in Blacklight::CatalogHelperBehavior#render_search_to_page_title_filter is expecting to be able to write applied filter labels out to the page title without doing anything to the labels. I'm not sure what the long-term answer ought to be - we should probably, maybe at least be html_safe on the resulting title? - but you could override that method to patch it in your app.

barmintor avatar Jul 28 '22 22:07 barmintor