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

HTML page title shows raw mathjax #262

Open
cellio opened this issue Nov 5, 2020 · 5 comments
Open

HTML page title shows raw mathjax #262

cellio opened this issue Nov 5, 2020 · 5 comments
Labels
area: markdown Changes to Markdown or its rendering complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: low type: bug Something isn't working

Comments

@cellio
Copy link
Member

cellio commented Nov 5, 2020

https://math.codidact.com/questions/278174

When someone includes TeX-like math between dollar signs ($) in a title, the title renders nicely but the HTML title renders raw (with the dollar signs and all). The latter is terrible for readability — and, I assume, screenreaders. This affects, presumably, wherever the HTML title appears: browser tab/window titles, search-engine results, etc.

Can we do anything to convert the mathjax into something that won't look confusing in a title? Or is this something to live with and/or avoid?

@cellio cellio added type: bug Something isn't working priority: low area: markdown Changes to Markdown or its rendering complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. labels Nov 5, 2020
@Trilarion
Copy link
Contributor

That should be doable. The HTML title can be modified by JavaScript, so one could after rendering the title, set the HTML title to the title.

@Trilarion
Copy link
Contributor

I now think it might not be doable. MathJax replaces $text$ with a series of HTML tags using CSS. That's not something that can be used in the page title. The page title is pure, unformatted text, I think. I searched and did not find a way to add formatting to the title tag.

Math.SE seems not to do it too (for example https://math.stackexchange.com/questions/21199/is-frac-textrmdy-textrmdx-not-a-ratio).

This means that for example search engines will have to live with this too. Google seems to strip some elements away though from the title, kind of alleviating the effect. See for example https://www.google.com/search?q=Is+dy%252Fdx+not+a+ratio

We could probably sanitize the page title a bit in order to improve. I could look into it. But first I would check if Google doesn't already do it for us too.

@Trilarion
Copy link
Contributor

Yes, google sanitizes titles by its own:

https://www.google.com/search?q=Why+does+the+decimal+expansion+of+have+this+neat+pattern%3F+site%3Amath.codidact.com

when displaying search results.

@Trilarion
Copy link
Contributor

Maybe we should discourage/replace wherever possible $$ expressions in titles.

Currently I'm searching for the equivalent of a screen reader for blind people for mathematical expressions. I want to know what they are doing with this kind of content.

@cellio
Copy link
Member Author

cellio commented Jan 21, 2022

Thanks for looking into what screenreaders do with math. That's gotta be a hard problem and now I'm curious.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: markdown Changes to Markdown or its rendering complexity: unassessed Needs further developer investigation before complexity/feasibility can be determined. priority: low type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants