openstax / oer.exports

Converter to various book formats (PDF, epub, mobi)
2 stars 0 forks source link

Add display attribute to mml:math elements if not already present #4067

Open aiwenar opened 3 years ago

aiwenar commented 3 years ago

When the display attribute is omitted from a <mml:math> element the renderer should infer it from context. An external renderer however may be unable to determine what the context is and fall back to an incorrect value. This PR seeks to avoid such situations by adding this attribute to <mml:math> elements (unless they already have one), with value of inline if it is nested in <cnx:para>, and block if it is nested in <cnx:equation>.