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

span tag in html/head/title when range selected #189

Open
kosarko opened this issue Jun 3, 2022 · 2 comments · May be fixed by projectblacklight/blacklight#3464
Open

span tag in html/head/title when range selected #189

kosarko opened this issue Jun 3, 2022 · 2 comments · May be fixed by projectblacklight/blacklight#3464

Comments

@kosarko
Copy link

kosarko commented Jun 3, 2022

With 0a1df5f (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

@barmintor
Copy link
Contributor

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.

@seanaery
Copy link
Collaborator

seanaery commented Dec 2, 2024

I have verified that this issue is still present when using Blacklight 8 (details/screenshot on #299 ).

seanaery added a commit to projectblacklight/blacklight that referenced this issue Dec 5, 2024
- E.g., span/data-attributes rendered for selected range facet values by blacklight_range_limit
- Fixes projectblacklight/blacklight_range_limit#189
seanaery added a commit to projectblacklight/blacklight that referenced this issue Dec 6, 2024
- E.g., span/data-attributes rendered for selected range facet values by blacklight_range_limit
- Fixes projectblacklight/blacklight_range_limit#189
seanaery added a commit to projectblacklight/blacklight that referenced this issue Dec 18, 2024
- E.g., span/data-attributes rendered for selected range facet values by blacklight_range_limit
- Does not affect typical values that are not marked html_safe
- Fixes #2707
- Fixes projectblacklight/blacklight_range_limit#189
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants