mirror of
https://github.com/TextPlace/CoreTextPlace.git
synced 2025-05-01 05:01:11 +00:00
Compare commits
No commits in common. "main" and "0.4.0" have entirely different histories.
3 changed files with 2 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@textplace/core",
|
||||
"version": "0.4.1",
|
||||
"version": "0.4.0",
|
||||
"exports": "./mod.ts",
|
||||
"imports": {
|
||||
"@deno/dnt": "jsr:@deno/dnt@^0.41.3",
|
||||
|
|
|
@ -10,6 +10,5 @@ export function getCharacterWidth(ch: string): number {
|
|||
);
|
||||
}
|
||||
|
||||
// TODO: Properly fix this.
|
||||
return Math.min(unicodeWidth(ch), 2);
|
||||
return unicodeWidth(ch);
|
||||
}
|
||||
|
|
|
@ -32,12 +32,6 @@ Deno.test("getCharacterWidth CJK", () => {
|
|||
assertThrows(() => getCharacterWidth("ヨスガノ"));
|
||||
});
|
||||
|
||||
Deno.test("getCharacterWidth Emoji", () => {
|
||||
assertEquals(getCharacterWidth("👋"), 2);
|
||||
assertEquals(getCharacterWidth("🌲️"), 2);
|
||||
assertEquals(getCharacterWidth("👨👩👧👦"), 2);
|
||||
});
|
||||
|
||||
Deno.test("getCharacterWidth previously faulty cases", () => {
|
||||
assertEquals(getCharacterWidth("𤲶"), 2);
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue