Mathjax in user name on profile page is not updating <title> tag

Bug #1815128 reported by Robert Lyon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Won't Fix
Medium
Unassigned

Bug Description

Eg If I have MathJax turned on and have 'displayname' for a user set to: \(\beta \alpha \delta \varsigma \pi \rho \)

When I visit their profile page I see their name displayed as βαδςπρ in page <h1> tag but the browser <title> still shows as \(\beta \alpha \delta \varsigma \pi \rho \) and makes things look broken

The MathJax is unable to update the <title> tag as it does it's magic with inserting <div> stuff.

But we can update the title tag with an approximation of what is wanted - eg for Greek letters they tend to exist in the font so we can scrape them from the page a apply them to the title.

For things like mathematical notations like square root we can't as they are made up by css tricks

So I'll add a bit of code to try and update the <title> tag so it looks less broken

Revision history for this message
Robert Lyon (robertl-9) wrote :

Question: "Could we just not allow MathJax in the username?"

Answer: This problem also exists for normal page titles as well

The main problem is mathjax symbols are made from allowed characters, eg the symbol for pi, π, is made from \(\pi \) all of which are valid chars for a title.

So I guess during page settings form save we'd need to check if mathjax plugin is enabled and mathjax shaped syntax occurs in the title field and to throw an error on saving.

For some symbols, eg pi, we can get a better result by selecting the character by using the tinymce 'special characters' button and selecting the symbol if it exists in the font.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

Thanks for the explanation, Robert. If MathJax is enabled on a site and the characters used but then disabled at some point, what happens?

We have the same problem in content of course I think, but there it is less visible as it's not the username or title.

Revision history for this message
Kristina Hoeppner (kris-hoeppner) wrote :

It's not the username but the display name.

We don't save the generated MathJax output and hence it's not resolved easily. We are not going to look into fixing this at the moment. If it becomes easier in the future, this can be tackled again.

Changed in mahara:
milestone: 19.04.0 → none
status: In Progress → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.