internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.09k stars 1.33k forks source link

Incorrect HTML Entity Displayed in Browser Tab Title for Search Query #9787

Open RayBB opened 3 weeks ago

RayBB commented 3 weeks ago

Problem

The browser tab title incorrectly displays HTML entities (e.g., ") instead of actual quotation marks for search queries.

image

https://openlibrary.org/search?q=%22The+Left+Hand+of+Darkness%22&mode=everything

Reproducing the bug

  1. Go to https://openlibrary.org/search?q=%22The+Left+Hand+of+Darkness%22&mode=everything

Context

Breakdown

Our best guess is that the issue is happening when the title is set, after the facets load via document.title = data.title here: https://github.com/internetarchive/openlibrary/pull/9397/files#diff-72a617aa8bc6a465e867c6a7b35f9c02693c6fb6e25b50b094891065e3d25034R81 that it's not encoding things correctly.

Related files

Stakeholders

*


Instructions for Contributors

poojatalele commented 3 weeks ago

@RayBB I would like to work on this, kindly assign :)

mekarpeles commented 2 weeks ago

@poojatalele we're happy for you to contribute -- the first step is for this issue to be broken down with a solution.

Our best guess is that the issue is happening when the title is set, after the facets load via document.title = data.title here: https://github.com/internetarchive/openlibrary/pull/9397/files#diff-72a617aa8bc6a465e867c6a7b35f9c02693c6fb6e25b50b094891065e3d25034R81 that it's not encoding things correctly. Please do propose a fix!

SeraphimRP commented 3 days ago

Hello. If there's an opportunity to take this on, I'd be happy to lend a hand.

jimchamp commented 2 days ago

This issue is being worked on by @poojatalele.

@poojatalele, can you give a progress update?