If the input text to text::analyze terminates with 0xa (line_break=LF), this mandatory break is not reported.
This is unimportant where whitespace may be trimmed, but an issue where with text editors where a trailing new-line must have a position.
Suggested fix: add fn is_mandatory_break to LineBreak and document that users of analyze should check this for the last char. (I'm not 100% sure this works with multi-byte breaks line \r\n, but I think here \r would not be reported so it would be fine.)
If the input text to
text::analyzeterminates with0xa(line_break=LF), this mandatory break is not reported.This is unimportant where whitespace may be trimmed, but an issue where with text editors where a trailing new-line must have a position.
Suggested fix: add
fn is_mandatory_breaktoLineBreakand document that users ofanalyzeshould check this for the lastchar. (I'm not 100% sure this works with multi-byte breaks line\r\n, but I think here\rwould not be reported so it would be fine.)