Fixes #7611: fix optgroup formatting for Firefox