MathCAT icon indicating copy to clipboard operation
MathCAT copied to clipboard

Write a browser extension to convert "HTML Math" for chemistry into MathML

Open NSoiffer opened this issue 2 years ago • 5 comments

This isn't really a MathCAT project, but it would open up more content to be available for MathCAT and I don't know where else to put it.

Currently there is an accessible-wikipedia-math extension that reverse engineers the HTML math used in Wikipedia for some inline math. That makes the inline math accessible (correct speech and correct braille). The idea here is to either add to that extension or create a new one. For example, $[\mathrm{SO}_4]^{2-}$ is encoded as:

<span class="chemf nowrap">[SO
     <sub class="template-chem2-sub">4</sub>
     ]
     <sup class="template-chem2-sup">2−</sup>
</span>

The classes above (and maybe some others) can be searched for and turned back into MathML's mmultscripts tag.

Note: for chemistry, mmultscripts should be used and not msub, etc., because mmultscripts will get the sub and superscript alignments right across multiple sub/superscripts.

This is a good project for someone who knows JavaScript because it is very similar to the math extension mentioned above.

NSoiffer avatar Jul 04 '23 05:07 NSoiffer

Hello! I would like to work on this issue. Thank You.

DebanganMishra40 avatar Jul 05 '23 13:07 DebanganMishra40

Great. When you are done, please close the issue.

Let me know if you have any questions.

NSoiffer avatar Jul 05 '23 18:07 NSoiffer

Sure!

DebanganMishra40 avatar Jul 06 '23 21:07 DebanganMishra40

@DebanganMishra40 Hey, if you're still working on this, I am interested in helping.

tara-stekel avatar Jul 09 '23 01:07 tara-stekel

Hi, I have experience writing browser extensions for Chromium browsers. Happy to provide any help if questions arise.

brichwin avatar Jul 11 '23 12:07 brichwin