diff --git a/deno.json b/deno.json index ffdf2b3..2ac2e2b 100644 --- a/deno.json +++ b/deno.json @@ -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", diff --git a/logic/character.ts b/logic/character.ts index 2d58dac..074001d 100644 --- a/logic/character.ts +++ b/logic/character.ts @@ -10,6 +10,5 @@ export function getCharacterWidth(ch: string): number { ); } - // TODO: Properly fix this. - return Math.min(unicodeWidth(ch), 2); + return unicodeWidth(ch); } diff --git a/tests/character.test.ts b/tests/character.test.ts index c8e3a65..d1330f9 100644 --- a/tests/character.test.ts +++ b/tests/character.test.ts @@ -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); });