为什么 "[x]y"RTL方向显示不正确? [英] Why does "[x]y" display incorrectly in the RTL direction?
问题描述
[x]y
您可以看到 HTML 文本 [x]y
显示为 x]y]
.
这个结果的原因是什么?
PS:我在 Chrome 56.0.2924.87(64 位)中得到了这个结果.
它被正确渲染,即根据规范.您已要求从右到左布局.渲染首先采用 [
字符.它在方向上是中性的,因此在最右侧的 RTL 运行中呈现并镜像(因此它看起来像 ]
).接下来,它的左边是 x]y
顺序,因为拉丁字母 x
和 y
具有固有的从左到右方向性和中性 ]
从它们那里获得方向性.
要得出的结论取决于您想要的渲染以及您使用从右到左方向性的原因.
<div style="direction: rtl">
[x]y
</div>
You can see HTML text [x]y
displays as x]y]
.
What is the reason of that result?
PS: I get that result in Chrome 56.0.2924.87 (64-bit).
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.
这篇关于为什么 &quot;[x]y&quot;RTL方向显示不正确?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!