mathjax/MathJax — Issue #194: Minor bug in autobold.js
Author: mri-systime
Created: 2012-02-24 13:12:06+00:00
State: open

Using autobold.js and rendering math inside an element with display: none, the math will be rendered in bold.

This is caused by offsetWidth being 0 (zero) when measuring an element inside an element with display: none.

Solution: add a check for non-zero width around lines [36-37 in autobold.js](https://github.com/mathjax/MathJax/blob/v2.0-candidate/unpacked/extensions/TeX/autobold.js#L36):

if (W > 0) {
span.style.fontWeight = "bold";
if (span.offsetWidth === W) {data.math = "\\boldsymbol{"+data.math+"}"}
}