Simon-Initiative / course-digest

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

[MER-2072] better handling of xref links #168

Closed marc-hughes closed 1 year ago

marc-hughes commented 1 year ago

Torus expects all links to be of {type: 'a'}, previously the digest tool was passing {type: 'xref} which would not display in a torus page correctly. This change converts those xref into a links, and handles a mismatch in content models. Some rules:

  1. An xref with a page attribute will have the resulting a link with an idref pointing to that page.
  2. An xref with an idref attribute will have the resulting a link with an anchor pointing to the idref. Currently, this is ignored in torus, but will be ingested and maintained if the link is edited.
  3. An xref without a page attribute, will have it's idref set to the current page. This is an unfortunate case since the link won't do anything until we start supporting the anchor attribute.

In all these cases, the target attribute is now passed an maintained in torus.

To test this end to end, you need the torus changes here: https://github.com/Simon-Initiative/oli-torus/pull/3705

Fixes https://github.com/Simon-Initiative/oli-torus/issues/3536