feat: add ArabicShaping table (Joining_Type) — fixes #101 - #102
Merged
Merged
Conversation
mathiasbynens
approved these changes
Sep 9, 2026
Collaborator
|
Some follow-up fixes were needed: ca10450 |
Contributor
Author
|
Thanks for merging + for the canonical-name fix in ca10450 — noted for next time (I see parse-bidi-class already did it that way; should have mirrored it). The committed data files for all versions look right. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #101.Adds ArabicShaping.txt (Joining_Type) support so consumers implementing Arabic text shaping alongside a bidi algorithm (e.g. bidi-js, maplibre-gl-js#8343) can depend on this package instead of rolling their own UCD downloader.Changes:- scripts/parse-arabic-shaping.mjs (new): parses code; name; Joining_Type; Joining_Group lines into per-value regenerate sets (explicit entries only, mirroring parse-bidi-class; unlisted code points stay implicit per the file's T/U default rule, same as other parsers here).- scripts/download.mjs: arabic-shaping in TYPES.- data/resources.mjs: arabic-shaping URLs for Unicode 3.2.0 through 18.0.0 (legacy -Update layout for 3.2.0/4.0.0/4.0.1, ucd/ afterwards — every URL HEAD-verified 200).- index.mjs: wires Joining_Type generation (after Vertical_Orientation).- tests/tests.mjs: snapshot test for Joining_Type/Dual_Joining on the newest version (auto-created on first run, like other snapshots).Verification (offline, no clone needed): parser run against the real ArabicShaping-17.0.0.txt yields exactly the file's distribution (D615/R153/U50/C7/L5/T4, 834 entries, no ranges); spot checks U+0628=D, U+0627=R, U+0621=U, U+0600=U, U+0640=C, U+200D=C; unlisted U+061C correctly absent; missing-file versions return undefined so pre-3.2.0 outputs are unchanged. Generated Joining_Type/D artifacts verified end-to-end (ranges decode, 615 code points incl. U+0628). node --check clean on all touched files.Notes: Joining_Group is parsed but intentionally not emitted (single-map convention per writeFiles call); unlisted-codepoint defaults (T for marks, U otherwise) are left implicit per spec rather than materialized, matching how this repo treats bidi-class defaults.