@@ -1760,4 +1760,21 @@ else return ct.parse_span(val, v.origin), false end end + +function ct.linkspans(link) + if link.spans and next(link.spans) then return link.spans end + + local o, id, s = link.origin:ref(link.ref) + if o then --TODO + if type(o) == 'table' then + end + return {id} + else -- it's a section link + if s.heading_node then + return s.heading_node.spans + end + end + + -- give up; the renderer decides how to represent this link +end