mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-10-31 12:03:39 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			331 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			331 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import type {Html} from "../../../common/html.js";
 | |
| 
 | |
| export function generateNodeFromHtml(html: Html): Element {
 | |
|   const wrapper = document.createElement("div");
 | |
|   wrapper.innerHTML = html.html;
 | |
| 
 | |
|   if (wrapper.firstElementChild === null) {
 | |
|     throw new Error("No element found in HTML");
 | |
|   }
 | |
| 
 | |
|   return wrapper.firstElementChild;
 | |
| }
 |