Skip to content

Conversation

@manuelsanchez2
Copy link

No description provided.

@manuelsanchez2
Copy link
Author

Ready to review/merge, @matuzo ! Hope you like it!

@ZoeBijl ZoeBijl changed the title ADVENT-25: add article for day 13 (a11y considerations in math on the web) Day 13: “A11y Considerations in Math on the Web” / Manuel Sánchez Oct 27, 2025
@ZoeBijl ZoeBijl added the advent25 all posts for the 2025 adventcalendar label Oct 27, 2025
@ZoeBijl ZoeBijl self-requested a review October 28, 2025 15:23
Copy link
Collaborator

@ZoeBijl ZoeBijl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you for your contribution, it was interesting to learn a bit more about MathML!

Maybe it has happened to you that you wanted to write some formulas in HTML to display them on a website, and even though there are multiple ways to do it, accessibility is often not considered in the process. How the formula is read by screen readers is crucial to ensure that we don't leave anyone behind.

## Heading
Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this flows a bit nicer with what you want to say. i tried to separate the cause and effect as it were.

Suggested change
Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula.
The web is full of many different and interesting approaches for representing formulas. In reality, [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option to solve this problem, even if it wasn’t originally designed for the web. A big plus is that it has its own syntax, MathML provides various elements that give the correct semantics to the different parts of a formula.

Let's take the famous Pythagorean Theorem as an example.

## Heading
<section style="margin-bottom: 2rem" >
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would it make sense to follow your own advise and use an aria-label here?

</section>
```

Alternatively, we also have the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role"><code>role="math"</code></a> from the ARIA specification. With that, even if you use an image or non-semantic HTML, you can still achieve accessibility. As shown on the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role">Mozilla page about <code>role="math"</code></a>, we could have:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Alternatively, we also have the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role"><code>role="math"</code></a> from the ARIA specification. With that, even if you use an image or non-semantic HTML, you can still achieve accessibility. As shown on the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role">Mozilla page about <code>role="math"</code></a>, we could have:
Alternatively, we also have the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role"><code>"math"</code> role</a> from the ARIA specification. With that, even if you use an image or non-semantic HTML, you can still achieve an accessibile result. As shown on the <a href="https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles/math_role">Mozilla page about <code>role="math"</code></a>, we could have:

</math>
```

<p class="highlight"><strong><abbr title="too long; didn't read">TL;DR:</abbr></strong> MathML Core is what browsers implement today; MathML 4 is the broader language evolving around it..</p>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think this should be at the top of the section. now it’s more of a “too late, did read” 🤓


## The future of MathML

Before we look ahead, it's useful to understand where MathML comes from and why there's both a 'Core' and a 'version 4' in development.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this might be the curse of knowledge on your part, but i have no idea that there’s a “core” and “version 4”. perhaps this section can be restructured a bit to include some more history and explain this?

Maybe it has happened to you that you wanted to write some formulas in HTML to display them on a website, and even though there are multiple ways to do it, accessibility is often not considered in the process. How the formula is read by screen readers is crucial to ensure that we don't leave anyone behind.

## Heading
Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reality is that MathML is usually the best option for this problem

can you support this claim? why is MathML better than say MathJax?

Maybe it has happened to you that you wanted to write some formulas in HTML to display them on a website, and even though there are multiple ways to do it, accessibility is often not considered in the process. How the formula is read by screen readers is crucial to ensure that we don't leave anyone behind.

## Heading
Even though the web is full of many different and interesting approaches, the reality is that [MathML](https://developer.mozilla.org/en-US/docs/Web/MathML) is usually the best option for this problem. It has its own syntax and was not originally designed for the web, but MathML provides various elements that give the correct semantics to the different parts of a formula.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Even though the web is full of many different and interesting approaches

it might be worth naming some of the other approaches.

</math>
```

Unlike plain HTML with <code>sup</code> or <code>span</code>, which only describe presentation, MathML defines each role explicitly:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good selling point for MathML. are there other solutions that offer this functionality too? or is this exclusive to MathML?

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

Labels

advent25 all posts for the 2025 adventcalendar

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants