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] Prevent stripping whitespace within popup anchor text [MER-1797] #152

Closed andersweinstein closed 1 year ago

andersweinstein commented 1 year ago

Adds <anchor> to the list of tags passed to the toJSON parser for which whitespace must be preserved. <Anchor> is used for the text within <extra> definition translated to popup in torus. Example below. While some semantic elements of this type wrap their content in <material>, which was being treated properly, this is not always necessary. Any tag that can contain text content beyond a plain text string must be included, so also included <translation>.

<extra>
  <anchor>Je <em style="emphasis">ne</em> sais <em style="emphasis">plus</em>.</anchor>
  <translation>I don’t know anymore.</translation>
</extra>