support middleware in wx.text