Page MenuHomePhabricator

hasMatchingAncestor is the wrong check for list tools
Closed, DuplicatePublic

Description

We currently traverse the entire node tree to determine if a particular context is inside a list, for the purpose of showing the state of the list tools, and deciding what action to take when they are used, or what tab is pressed.

What we actually care about is whether the immediate branch node container is a listItem, not the entire tree, for example:

*
* # This context thinks it has a bullet list ancestor, but we should only return true for numbered list ancestor

image.png (238×696 px, 25 KB)

Also a table cell inside a table inside a list reports as having a list ancestor, even though we shouldn't treat that as a list item context. (This is more of an edge case as it shouldn't be possible in normal wikitext)

Event Timeline

JTannerWMF subscribed.

Moved to the freezer but if you believe we need to fix this for our toolbar work feel free to move it to quarterly queue @Esanders