findWrapping support inner node attrs

Background: When using markdown syntax to quickly create a task list, you need to specify the checked attribute of task-item (eg: ), but currently findWrapping method does not support specifying the attributes of the inner node. Due to some reasons in our project, inputrules are currently implemented in task-list instead of task-item

Question: Is it possible to make the findWrapping method support the specification of the attributes of the inner node?Is there anything else I need to pay attention to?

Looking forward to hearing different opinions from everyone, thank you~

You could take the array returned by findWrapping and build a new one with the same type fields but different attrs, and then pass that to wrap.

Thanks for the reply! This works, but it means I need to write separate if else checks, which makes some methods less general. So I’m thinking that if the findWrapping method can support types like Map<type, Attrs>, it might be more general.