While attempting to get Table Captions to work using a custom plugin, I kept encountering an error of tableCell.getChild is not a function when typing in the caption I created.
I believe this is because the caption element in the table element is being treated as a TableCell, which causes an error. I tried to document as best I could on this stackoverflow question, but I do believe my issue lies within the TableWalker.
This is in a very large project consisting of multiple CKEditor5 plugins to allow for a very customized schema. Here is a gist, however, of the files relating to the TableCaption. Some custom schema bits can probably be removed to simplify it.
cc @jodator
Yes, most features probably do that - AFAIR I encountered similar behavior in Image. Unfortunately we left such cases to be implemented together with https://github.com/ckeditor/ckeditor5-table/issues/66.
@Reinmar I'd consider this as a bug because we limit users with extending the table feature. I also expect that the fix should be time-consuming for TableWalker alone but I don't recall if other parts of the table feature (converters mostly) are aware of such change (but they should).
I think that there might be a problem with converters also - they might partially work (I'm quite sure that we fixed downcast conversion to allow inserting table selection handler).
Yup, lack of extensibility of such features as images or tables is a problem, indeed. The whole concept of converters was designed in a way which opens them for extension, but specific features can sometimes close these doors. The reason for that is the initial simplicity – to not overcomplicate the first implementations, we assume some things and the extensibility becomes really tricky. Also, we didn't learn still much about implementing this kind of features in an extensible way to make the right moves now. I think we'll start investigating this when we'll work on table captions, which should happen still this year. But before that, it's hard to tell for me how much work there's to do.
tl;dr I don't have answers for now. It requires investigation. But opening those features for extensions is definitely on our long-term roadmap.
Thanks for looking into this issue and for working so hard on this amazing editor. I've really enjoyed learning it and customizing it to fit my organization's use cases.
I've linked this issue to general TableWalker improvements: #6785.
Actually I was wrong - as @niegowski pointed out we cannot fix that in one place. Many other table algorithm works with that assumptuion.
Actually it is related to #3204.
We discussed this and unfortunately, it would require reviewing too many algorithms. We won't be able to work on it now. Sorry for the bad news :(
Most helpful comment
Thanks for looking into this issue and for working so hard on this amazing editor. I've really enjoyed learning it and customizing it to fit my organization's use cases.