mathjax / mathjax/MathJax

[A] omitting open bracket close bracket in speech (v4)

Open
#3,561 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Expected Behavior SRE v4
Dominant language
JavaScript
Stars
10.9k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

Issue Summary

When rendering ([A]), the braille is properly putting the open and closed square bracket characters, but the clearspeech is just saying "A"

In some cases, the clear speech is omitting the open and closed bracket in the verbalization. This is important because the open and close bracket (in chemistry) signifies the molar solution of the interior chemical.

This looks to only happen if the interior of the brackets is NOT a mathjax expression. It behaves normally when it has an expression, or you use \text{A} within:

([A]) (Improperly says just "A"): \

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mo stretchy="false">[</mo>
  <mi>A</mi>
  <mo stretchy="false">]</mo>
</math>

([\text{A}]) (Properly says open and close bracket): \

<math xmlns="http://www.w3.org/1998/Math/MathML">
  <mo stretchy="false">[</mo>
  <mtext>A</mtext>
  <mo stretchy="false">]</mo>
</math>

It may have to do with the similar logic that sets the say-as interpret-as="character" attribute...possibly...

Steps to Reproduce:
  1. Render ([A]) and analyze the speech for it, it omits the open and close bracket around the A in the verbalization
  2. Render ([\text{A}]) or ([A_1]) and analyze the speech for it, this will verbalize the open and close brackets.

In both cases, it should verbalize "Open bracket A Close Bracket"

Technical details:
  • MathJax Version: 4
  • Client OS: Windows 11
  • Browser: Edge

I am using the following MathJax configuration:

window.MathJax = {
	loader: {
    load: ['[tex]/units', '[custom]/siunitx.js', '[tex]/gensymb', '[tex]/color', '[tex]/html', '[tex]/cancel', '[tex]/enclose', '[tex]/mhchem'],
    paths: { custom: "/js/individual/scripts",
      fonts: "/js/individual/scripts"
     },
  },
		tex: {
      inlineMath: {'[+]': [['$', '$']]},
      packages: {'[+]':['siunitx', 'gensymb', 'color', 'html', 'cancel', 'units', 'descriptive-macro', 'el-macro', 'enclose', 'mhchem']},
      macros: {
        // there are a LOT, none of which impact this
},
      siunitx: {
        'per-mode': 'fraction'
      }
		},
    options: {
      enableEnrichment: true,
      sre: {
        domain: "clearspeak"
      },
      safeOptions:{
          classPattern: /^mjx-[-a-zA-Z0-9_.]+$|MathML-Unit/
      }
    },
		output: {
      font: 'mathjax-fira',
      fontPath: '[fonts]/%%FONT%%-font',
		},
		svg: {
		  fontCache: 'global'
		}
	};

and loading MathJax via custom.

Supporting information:
  • To test, go to our Markdig Tester and type in $[A]$ $[\text{A}]$ and hit view

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the MathML cases for [A], [text{A}], and [A_1] with the clearspeak configuration described in the issue, then inspect the speech-rendering path involved in bracket handling and the say-as character logic. Done means [A] is verbalized as "Open bracket A Close Bracket" while the existing cases continue to speak correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
accessibility
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.