servo / unicode-bidi

Implementation of the Unicode Bidirection Algorithm in Rust
Other
78 stars 33 forks source link

[para-api] Create ParagraphBidiInfo structs as API for processing a single paragraph at a time #115

Closed jfkthame closed 11 months ago

jfkthame commented 11 months ago

This gives us ParagraphBidiInfo and utf16::ParagraphBidiInfo structs, which work like BidiInfo but are explicitly single-paragraph APIs.

(If there's a paragraph separator present in the text, they'll simply treat it like a segment separator. An alternative would be to return some kind of error if this happens.... thoughts?)

I extended test_process_text() to also run its single-paragraph testcases through the new APIs, and also added a couple of tests of what happens when text with a paragraph separator is (erroneously) passed here, to confirm that we handle it as expected.

Manishearth commented 11 months ago

Thanks!

jfkthame commented 11 months ago

And thank you! :)