Skip to content

Map common superscript and subscript characters - #218

Open
agammann wants to merge 1 commit into
simov:masterfrom
agammann:map-superscript-subscript
Open

agammann wants to merge 1 commit into
simov:masterfrom
agammann:map-superscript-subscript

Conversation

@agammann

Copy link
Copy Markdown

Fixes #195.

Map the common superscript and subscript digits and the letters used in ordinal suffixes to their plain ASCII equivalents. This keeps the numeric meaning of units and chemical formulas in slugs: 15 m³ now becomes 15-m3, and H₂O becomes H2O. The generated slugify.js map is rebuilt from config/charmap.json.

Added regression cases for both examples, the digit sets, and ordinal suffixes.

Local verification: node node_modules/mocha/bin/mocha --recursive passed all 46 tests; direct Node execution confirmed the example outputs; git diff --check passed. The package test script calls npx, which is unavailable in this environment, so Mocha was run directly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Superscript and subscript characters

1 participant