Closed rbakhshi closed 10 years ago
To be honest, directionality only really color codes grammatical units, and if a unit is completely LTR or RTL, sets that value as the DOM node’s dir
attribute. Thus, a bidirectional paragraph is not marked with any actual dir
(although its sentences might).
You say the direction of the first sentence (the first child) should be applied to paragraph (the parent):
Regarding 1. and 2., if I add [dir="rtl"]
to an ancestor (such as body
or .directionality__output
), the paragraph shows up as you recommended.
In fact, I’m not sure I as a plugin developer should choose a ratio to apply neutral, LTR, or RTL directionality. Maybe it’s best to let users find that out on their own: such as, when a RootNode is classified as "neutral", detect which direction is used more than the other and apply that to a DOM node?
Did that help? Can I close this issue?
Yup. Thanks. Feel free to close it On 12/08/2014 9:52 PM, "Titus" notifications@github.com wrote:
Did that help? Can I close this issue?
— Reply to this email directly or view it on GitHub https://github.com/wooorm/retext/issues/15#issuecomment-51906575.
Cool! Let me know if you have any other questions! :smile:
the demo (http://wooorm.github.io/retext-directionality/) tries to show how bidi text can be detected and handled by retext. The line with both Hebrew and English should be right to left as it starts with Hebrew.