I would like square brackets to never be italicized, even in a \textit environment. That is, I would like to type [ but have it always replaced with \textup{[}, and similarly for the right bracket. Apparently \newunicodechar doesn't work for the standard ASCII characters.
Is there some other way?
\textit{\bracket{foo} bar}, but are you looking to make[and]active characters and not have the other versions available at all? – Davislor Jul 14 '18 at 19:37