mirror of
				https://github.com/zulip/zulip-desktop.git
				synced 2025-11-04 05:53:21 +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;
 | 
						|
}
 |