No, that’s not the reason, at least not from CKEditor’s point of view. The editor should have no problem handling image captions using <figure>
/<figcaption>
tags. The problem is that these tags have no correspondent in wiki syntax so they were simply lost when converting the HTML to wiki syntax. Thus we need two things:
- make sure the caption information ends up in the XDOM when the HTML is parsed (which probably means extending the existing HTML parser or using another HTML5 one)
- make sure the caption information ends up in the wiki syntax when the XDOM is rendered (which probably means modifying the XWiki 2.1 syntax renderer)
Which is what you explained below.
I don’t see how we could do this without hard-coding the figure
macro into the CKEditor image feature, which I don’t like. Basically the image CKEditor plugin would have to:
- on load: look for figure macro calls and replace them with images with captions
- on save: replace images with captions with figure macro calls
But what happens with the other content inside the figure macro that is not an image in this case?.. I think I prefer the native syntax solution.