https://bugzilla.wikimedia.org/show_bug.cgi?id=65568
--- Comment #7 from Moriel Schottlender <mor...@gmail.com> --- (In reply to Roan Kattouw from comment #4) > Well, you can most certainly trust node.getType() to tell you if calling > node.getCaptionNode() will cause it to explode or not, and you apparently > can't trust imgModel.getImageNodeType() in this case ;) Yes, fallbacks should be included. I think the current (merged) commit dealt with that, I hope no more bugs will come with it, but I'll go over the code to verify. > Yup, that sounds reasonable. However, we'd also have to define what happens > when we inspect a node whose type appears to be "wrong"; we probably > shouldn't change its type if the user didn't change any of the flags. OTOH, > this just shouldn't happen. That would be a problem, though -- how would we know that the type is wrong? It's not like the user consciously chooses inline vs block. The inline/block type is defined by seemingly arbitrary flags. They're not completely arbitrary, which is good, but they're also not entirely intuitive either. The only way to know for sure is through the tests in the getImageNodeType. It just has to be verified to follow the right conditions. In this case, I had a typo in there, and from my tests so far this *should* be true for all the cases I tested, but I am slightly concerned we may be missing things with wikitext, or that if new types are added we will have to adjust as well. -- You are receiving this mail because: You are on the CC list for the bug. _______________________________________________ Wikibugs-l mailing list Wikibugs-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikibugs-l