FontoXML / fontoxpath

A minimalistic XPath 3.1 implementation in pure JavaScript
MIT License
133 stars 17 forks source link

Format integer RTL #607

Closed drex04 closed 1 year ago

drex04 commented 1 year ago

Extends the format-integer XPath function to be able to handle numbering styles from Arabic, Hebrew, and Persian.

DrRataplan commented 1 year ago

small nitpick, but the spec actually requires one to allow the whole digit family range for that writing system to be allowed:

The corresponding output format is a decimal number, using this digit family, with at least as many digits as there are mandatory-digit-signs in the format token. Thus, a format token 1 generates the sequence 0 1 2 ... 10 11 12 ..., and a format token 01 (or equivalently, 00 or 99) generates the sequence 00 01 02 ... 09 10 11 12 ... 99 100 101. A format token of ١ (Arabic-Indic digit one) generates the sequence ١ then ٢ then ٣ ...

Note that my favourite reference implementation also does not do this correctly, so I'm fine with the current state.

A rebase should fix the bundle size stuff by the way

bundlemon[bot] commented 1 year ago

BundleMon

Files updated (2) Status | Path | Size | Limits :------------: | ------------ | :------------: | :------------: :white_check_mark: | fontoxpath.js
| 77.29KB (+1.01KB +1.33%) | - :white_check_mark: | fontoxpath.esm.js
| 77.36KB (+997B +1.27%) | -

Total files change +1.99KB +1.3%

Final result: :white_check_mark:

View report in BundleMon website ➡️


Current branch size history | Target branch size history

coveralls commented 1 year ago

Coverage Status

coverage: 91.546% (+0.05%) from 91.497% when pulling ff53bf9ca7a0478f92e7b23a94948b13b098b24a on format-integer-RTL into a2868b2bd34e520f2d00c8aa38a762348762759e on master.