-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Presumably it does, but it is not clear how (in particular, the name may be wrong).
HL1 states:
Override P3, and set the paragraph embedding level explicitly. This does not apply when deciding how to treat FSI in rule X5c.
... then gives some suggestions for how this may do so, but no specific requirement. One of those suggestions is to follow P2 and P3, but default to level 1 (RTL).
What I find from testing is that providing Some value via default_para_level to BidiInfo::new overrides the paragraph level. Given the name, I would expect that instead it only acts as a default (i.e. when P2 does not find a strongly directional character).
Suggestions:
- Rename
default_para_leveltooverride_para_level - Make
default_para_levelact only when no strongly-directional (L/AL/R) character is found. (In this case, it does not need to be optional.) - Revise to support both cases:
pub fn new(text: &str, default_para_level: Level, override_para_level: Option<Level>) -> BidiInfo<'_>
From a usage point-of-view, I can see value in being able to specify a default line direction (i.e. suggestion 2) for e.g. an input field when it may be empty or contain only formatting characters. The current behaviour (override) achieves the same thing, but also messes up formatting when the directionality is detectable (e.g. a sentence with a full stop as in #52), for little gain.