It is rendered correctly, i.e. according to specifications. You have asked for right-to-left layout. The rendering first takes the [
character. It is directionally neutral and therefore rendered in a RTL run rightmost and mirrored (so it looks like ]
). Next, to the left of it comes x]y
in that order, since the Latin letters x
and y
have inherent left-to-right directionality and the neutral ]
gets its directionality from them.
The conclusions to be drawn depends on the rendering you want and your reasons for using right-to-left directionality.