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

Redundant text in <title> and title attribute in links #2162

Closed
rzach opened this issue Jul 24, 2023 · 5 comments · Fixed by #2207
Closed

Redundant text in <title> and title attribute in links #2162

rzach opened this issue Jul 24, 2023 · 5 comments · Fixed by #2207

Comments

@rzach
Copy link

rzach commented Jul 24, 2023

LaTeXML generates very verbose document titles (<title>) tags and title= attributes in navigation links. The <title> tag of a chapter is

Chapter X <chapter title> ‣ <document title> ‣ <document title>

and if there are parts:

Chapter X <chapter title> ‣ Part X <part title> ‣ <document title> ‣ Part X <part title> ‣ <document title>

(That's definitely a bug since the document title should at least not repeat).

A navigation link to a section, say, will have

<a href=... title="Chapter X <chapter title> ‣ Part X <part title> ‣ <document title>">X Chapter title</a>

A screen reader reads out the document title when the page loads, and the title attribute in addition to the link text, so navigating a table of contents or navigation menu with a screen reader is not a good experience.

@rzach
Copy link
Author

rzach commented Jul 24, 2023

PS Just noticed that every \ref will generate a link with such a verbose title attribute, e.g., "item X > Y.Z Section title > Chapter Y > Part U Part title > Document title".

@dginev
Copy link
Collaborator

dginev commented Jul 24, 2023

This is quite important, thank you for flagging it:

A screen reader reads out the document title when the page loads, and the title attribute in addition to the link text, so navigating a table of contents or navigation menu with a screen reader is not a good experience.

@brucemiller
Copy link
Owner

Kinda hard to work with broad claims like "definitely a bug", without a bit more clarity. Why shouldn't the document title be "repeated"? It tells you, with context, where the link will take you; which is what it's supposed to do as I understand it. I don't really follow what you're saying the screen reader is doing; it's reading out all the links and their title attributes from the table of contents when you load the page? That doesn't sound very useful. OTOH, if you've navigated to a link (whether in table of contents or not), shouldn't there be clear indication of where it will go?

Perhaps the verbosity should be a bit more variable? Less detail in tables of contents?

@rzach
Copy link
Author

rzach commented Jul 26, 2023

Apologies for not being clear enough!

On the "bug" relating to repeated items within the <title> tag: I meant the title of the page in the <head> section, e.g., on https://forallx.openlogicproject.org/html/Ch4.html you have

<!DOCTYPE html><html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Chapter 4 First steps to symbolization ‣ Part II Truth-functional logic ‣ forall x: Calgary. An Introduction to Formal Logic‣ Part II Truth-functional logic ‣ forall x: Calgary. An Introduction to Formal Logic</title>
<!--Generated on Wed Jul  5 22:21:48 2023 by LaTeXML (version 0.8.7) http://dlmf.nist.gov/LaTeXML/.-->

Chapter, part, book title, part title repeated, book title repeated. Or on https://math.nist.gov/~BMiller/LaTeXML/manual/intro/ you have

<title>Chapter 1 Introduction ‣ LATExml The Manual‣ LATExml The Manual</title>

On what the screen reader does: And yes, that's what the screen reader (ChromeVox) is doing: it assumes that what's in the title attribute is important and so reads it out, but of course also reads out the link text. So the TOC link to the above chapter sounds like this: "Chapter 4 First steps to symbolization right triangle Part II Truth-functional logic right triangle forall x: Calgary. An Introduction to Formal Logic right triangle Part II Truth-functional logic right triangle forall x: Calgary. An Introduction to Formal Logic 4 First steps to symbolization"

It's not technically a requirement of WAGS but here's what the WAVE accessibility tool https://wave.webaim.org/ tells you if you have a link with the title attribute repeating the link text:

Alerts
Redundant title text
What It Means
Title attribute text is the same as text or alternative text.
Why It Matters
The title attribute value is used to provide advisory information. It typically appears when the users hovers the mouse over an element. The advisory information presented should not be identical to or very similar to the element text or alternative text.
How to Fix It
In most cases the title attribute can be removed, otherwise modify it to provide advisory, but not redundant information. Note that the title text may or may not be read by a screen reader and is typically inaccessible to sighted keyboard users.

@brucemiller
Copy link
Owner

Yikes; I hadn't noticed that duplication; it doesn't happen in the places where I paid most attention! I also was thinking of the h1 "title", rather than the head title. So, we can change "definitely" to "obviously a bug".

And (again in the places I paid most attention), the link text are much abbreviated, so having the full title in the @title isn't much of a repetition. Tables of contents links are obviously a different situation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants