Similar to formula, image is a mixed tag in that it can appear inline and as block. We have to handle detecting when there is an image tag (already renamed here to img) that sits at the top level, but whose sibliings are text. Basically, if this image really needs to be treated as an inline element, then we rename it to img_line. Same solution that we have for formula.
This fixes problems where a stem of a question looks like this:
<stem>
Take a look at the image below:
<image src="..."/>
</stem>
The first line of the stem gets stripped out if we leave this image as a block image, so we must convert it to inline.
Generate a chemistry course digest and look at the page "Bohr Model of the Atom Calculations", the last inline has two questions. One of them exhibits the above question stem structure.
Similar to
formula
,image
is a mixed tag in that it can appear inline and as block. We have to handle detecting when there is an image tag (already renamed here toimg
) that sits at the top level, but whose sibliings are text. Basically, if this image really needs to be treated as an inline element, then we rename it toimg_line
. Same solution that we have forformula
.This fixes problems where a stem of a question looks like this:
The first line of the stem gets stripped out if we leave this image as a block image, so we must convert it to inline.
Generate a chemistry course digest and look at the page "Bohr Model of the Atom Calculations", the last inline has two questions. One of them exhibits the above question stem structure.