Simon-Initiative / course-digest

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

[BUGFIX] fix lost popup content [MER-2696] #209

Closed andersweinstein closed 10 months ago

andersweinstein commented 10 months ago

This fixes two issues involved with missing popup (legacy <extra>) content. First, popup content may be specified in the <extra> element content without being wrapped in a semantic subelement like meaning or translation. This case was not being handled.

Second, standard content manipulations to strip bad nested HTML, for example to strip an unordered list within a paragraph, were using selectors that reached down into all descendants. So if a paragraph contained text with an extra (popup) that contained structured content like an unordered list, the nested list level would be stripped because it is contained within a paragraph, leading to incorrect content in the popups. This change revises the selectors to reach only immediate children.