AtrributeExtractors in V2

Following Zef’s example here, I’m wondering if the same mechanism can be used to parse out attributes from the main text. But I can’t seem to get this:

local mt = {
  __index = function(self, attr)
    if attr == "pageDecoration" then
      return {
        prefix = "🎄 "
      }
    end
  end
}

index.defineTag {
  name = "tree",
  metatable = mt
}

#tree

Sup

${query[[from index.tag “tree” select {name=name, pageDecoration=_.pageDecoration}]]}

to work, in a new tag or on existing tags.