Skip to content

Commit

Permalink
Recognize full width symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
as-cii committed Oct 15, 2015
1 parent 1fc9a25 commit a3c3b48
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/text-utils-spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ describe 'text utilities', ->

expect(textUtils.isDoubleWidthCharacter("")).toBe(true)
expect(textUtils.isDoubleWidthCharacter("")).toBe(true)
expect(textUtils.isDoubleWidthCharacter("")).toBe(true)

expect(textUtils.isDoubleWidthCharacter("a")).toBe(false)

Expand Down
3 changes: 2 additions & 1 deletion src/text-utils.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ isCjkUnifiedIdeograph = (charCode) ->
0x4e00 <= charCode <= 0x9faf

isFullWidthForm = (charCode) ->
0xFF01 <= charCode <= 0xFF5E
0xFF01 <= charCode <= 0xFF5E or
0xFFE0 <= charCode <= 0xFFE6

isDoubleWidthCharacter = (character) ->
charCode = character.charCodeAt(0)
Expand Down

0 comments on commit a3c3b48

Please sign in to comment.