parent
							
								
									999d560703
								
							
						
					
					
						commit
						e3debcc5e1
					
				
					 2 changed files with 3 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -9,7 +9,7 @@ export function replaceEmoji (string, replacer) {
 | 
			
		|||
 | 
			
		||||
  function safeReplacer (substring) {
 | 
			
		||||
    // emoji regex matches digits and pound sign https://git.io/fpl6J
 | 
			
		||||
    if (substring.match(/^[0-9#*]+$/)) {
 | 
			
		||||
    if (substring.match(/^[0-9#*™®]+$/)) {
 | 
			
		||||
      return substring
 | 
			
		||||
    }
 | 
			
		||||
    return replacer(substring)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -67,8 +67,8 @@ describe('test-emoji.js', function () {
 | 
			
		|||
      `it's over #9000`
 | 
			
		||||
    )
 | 
			
		||||
    assert.strictEqual(
 | 
			
		||||
      replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£`, replacer),
 | 
			
		||||
      `woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£`
 | 
			
		||||
      replaceEmoji(`woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®`, replacer),
 | 
			
		||||
      `woot !@#$%^&*()~` + '`' + `{[}]:;"'<,>.?/£™℠®`
 | 
			
		||||
    )
 | 
			
		||||
  })
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue