mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 14:03:27 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			13 lines
		
	
	
		
			328 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			328 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import type {HTML} from "../../../common/html";
 | 
						|
 | 
						|
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;
 | 
						|
}
 |