stencila/encoda

fix(Markdown): resolve citations within figure, table and chunk captions

nokome opened this issue · 0 comments

Currently, in Markdown Cite nodes in figure, table and chunk captions are not being resolved e.g.

image

This is likely because the decodeCite function does not get passed a context when called from within decodeCodeChunk etc. A quick fix would be to pass through the context. But I do wonder if it wouldn't be better to not pass the context around as we are currently doing and instead resolve the cite nodes separately using the transform function after doing the first decoding pass. I suspect that this would reduce the complexity of the code and make it easier to debug issues like this.