Simon-Initiative / course-digest

Tool to produce a summary or digest of OLI course package contents
MIT License
2 stars 0 forks source link

[BUG FIX] handle image tags that should be inline image tags #116

Closed darrensiegel closed 1 year ago

darrensiegel commented 1 year ago

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.