You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
		
			
		
			
				
					31 lines
				
				684 B
			
		
		
			
		
	
	
					31 lines
				
				684 B
			| 
											3 years ago
										 | var matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g; | ||
|  | var htmlEntities = { | ||
|  |   '&': '&', | ||
|  |   '&': '&', | ||
|  |   '<': '<', | ||
|  |   '<': '<', | ||
|  |   '>': '>', | ||
|  |   '>': '>', | ||
|  |   ''': "'", | ||
|  |   ''': "'", | ||
|  |   '"': '"', | ||
|  |   '"': '"', | ||
|  |   ' ': ' ', | ||
|  |   ' ': ' ', | ||
|  |   '©': '©', | ||
|  |   '©': '©', | ||
|  |   '®': '®', | ||
|  |   '®': '®', | ||
|  |   '…': '…', | ||
|  |   '…': '…', | ||
|  |   '/': '/', | ||
|  |   '/': '/' | ||
|  | }; | ||
|  | 
 | ||
|  | var unescapeHtmlEntity = function unescapeHtmlEntity(m) { | ||
|  |   return htmlEntities[m]; | ||
|  | }; | ||
|  | 
 | ||
|  | export var unescape = function unescape(text) { | ||
|  |   return text.replace(matchHtmlEntity, unescapeHtmlEntity); | ||
|  | }; |